Mohidul Islam 2 年之前
父节点
当前提交
52e9b8599f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      analytics/views.py

+ 2 - 2
analytics/views.py

@@ -114,8 +114,8 @@ def weeklyreportlist(request):
 
 def report_by_date_range(requests, location_id):
     location = Location.objects.get(pk=location_id)
-    start_date = requests.GET['start_date']
-    end_date = requests.GET['end_date']
+    start_date = requests.GET.get('start_date')
+    end_date = requests.GET.get('end_date')
     if start_date:
         start_date = make_aware(datetime.strptime(start_date, "%Y-%m-%d"))
     else: