Skip to content

Commit

Permalink
Only allow exporting if you're a board member
Browse files Browse the repository at this point in the history
  • Loading branch information
Mstiekema authored and Merijn Stiekema committed Dec 12, 2023
1 parent fcea458 commit 9b3f11d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions admin_board_view/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ def export_sale_transactions(request):
Returns:
HttpResponse: The csv file containing the sale transactions in the given date range.
"""
# Only allow export for authanticated users
if not request.user.is_superuser:
return HttpResponse("You are not authenticated.", status=401)

try:
req_get = request.GET
export_type = req_get.get('type')
Expand Down

0 comments on commit 9b3f11d

Please sign in to comment.