diff --git a/accounting/views.py b/accounting/views.py index 486eacd..d11654c 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -19,7 +19,7 @@ """ -from django.http import HttpResponseRedirect +from django.http import HttpResponseRedirect, HttpResponse from django.urls import reverse from django.utils import dateformat, timezone @@ -79,6 +79,8 @@ class BaseReportView(generic.ListView): Returns: The response """ + if request.user.is_anonymous: + return HttpResponse(status=401) try: self.page_size = int(request.GET["page-size"]) if self.page_size < 1: @@ -113,6 +115,7 @@ class BaseReportView(generic.ListView): return r + class CashReportView(BaseReportView): """The accounting cash report.""" http_method_names = ["get"]