Addded a simple authentication request to the cash report view.

This commit is contained in:
依瑪貓 2020-07-06 00:10:38 +08:00
parent 714086e8e2
commit 62f960c081

View File

@ -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"]