From 1deba9e39003283c6b284efe9c602ce291996ba9 Mon Sep 17 00:00:00 2001 From: Saurabh Bharswadkar Date: Mon, 4 Jun 2018 22:44:38 +0530 Subject: [PATCH] exception while exporting user csvs for non ajax request fixed --- gnowsys-ndf/gnowsys_ndf/ndf/views/gcourse.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/gcourse.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/gcourse.py index 7e236d1349..a4fe120c48 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/gcourse.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/gcourse.py @@ -2817,8 +2817,10 @@ def course_analytics(request, group_id, user_id, render_template=False, get_resu return analytics_data template = "ndf/lms.html" - - ajax_request = request.GET.get("ajax_request",'') + if request: + ajax_request = request.GET.get("ajax_request",'') + else: + ajax_request = None if request: # let's keep all get calls from request in this block. # so that we can use this method for api calls