Fixed security issue for get_gantt_data method #2280

Review ID: 6783002
Flask raised RuntimeError when the user wasn't logged-in.
"RuntimeError: working outside of application context"