From a968e59cf1123f83002f775a1055f30f06628153 Mon Sep 17 00:00:00 2001 From: Alexander Werner Date: Thu, 9 Mar 2017 19:50:39 +0100 Subject: [PATCH] fixed error if report_user not set --- billard/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/billard/views.py b/billard/views.py index e1e610b..9ad0793 100644 --- a/billard/views.py +++ b/billard/views.py @@ -32,7 +32,10 @@ class LocationDataDetailView(DetailView): @login_required def accountmodalview(request): - account = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid).first + try: + account = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid).first + except Client.DoesNotExist: + account = None context = { 'account': account }