From a3da6744114f7e4df8945848717551648eac90e8 Mon Sep 17 00:00:00 2001 From: Nicholas Schoenfeld Date: Fri, 22 Sep 2023 11:34:18 -0400 Subject: Added admin user to people who can access bookings Change-Id: Ib226f354caf1b8b357dc106ca58224dd20ad2c1d Signed-off-by: Nicholas Schoenfeld --- src/booking/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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, -- cgit 1.2.3-korg