Addded a simple authentication request to the cash report view.
This commit is contained in:
parent
714086e8e2
commit
62f960c081
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user