fixed bug with no settings in statistic page

This commit is contained in:
tkupek 2016-03-05 13:20:23 +01:00
parent 1ba6ed1980
commit 9b0708fdff
2 changed files with 8 additions and 0 deletions

Binary file not shown.

View file

@ -135,6 +135,14 @@ def statistic(request):
token = request.GET.get('token') token = request.GET.get('token')
try:
settings = Setting.objects.get(active=1)
except ObjectDoesNotExist:
settings = None
if settings is None:
return render_to_response('setting_null.html')
try: try:
auth = Setting.objects.get(active=1, token=token) auth = Setting.objects.get(active=1, token=token)
except ObjectDoesNotExist: except ObjectDoesNotExist: