aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicholas Schoenfeld <nschoenfeld@d122195.iol.unh.edu>2023-09-22 11:34:18 -0400
committernschoenfeld <nschoenfeld@iol.unh.edu>2023-09-28 15:18:13 -0400
commita3da6744114f7e4df8945848717551648eac90e8 (patch)
tree90a96f907ff51298d2d6b73d367e5ceaa9eb9885 /src
parent4ecf03b0a8517a8323dd888fc74e371aab41ba67 (diff)
Added admin user to people who can access bookings
Change-Id: Ib226f354caf1b8b357dc106ca58224dd20ad2c1d Signed-off-by: Nicholas Schoenfeld <nschoenfeld@iol.unh.edu>
Diffstat (limited to 'src')
-rw-r--r--src/booking/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/booking/views.py b/src/booking/views.py
index c99e2c2..c6df8a1 100644
--- a/src/booking/views.py
+++ b/src/booking/views.py
@@ -8,7 +8,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-from django.contrib import messages
+from django.contrib import messages, admin
from django.shortcuts import get_object_or_404
from django.http import JsonResponse, HttpResponse
from django.utils import timezone
@@ -80,10 +80,11 @@ def booking_detail_view(request, booking_id):
booking = get_object_or_404(Booking, id=booking_id)
statuses = get_booking_status(booking)
allowed_users = set(list(booking.collaborators.all()))
+ if (request.user.is_superuser):
+ allowed_users.add(request.user)
allowed_users.add(booking.owner)
if user not in allowed_users:
return render(request, "dashboard/login.html", {'title': 'This page is private'})
-
context = {
'title': 'Booking Details',
'booking': booking,