aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2023-10-03 18:23:12 +0000
committerGerrit Code Review <gerrit@opnfv.org>2023-10-03 18:23:12 +0000
commitca3d57fbcbee0ae979d3c3c02ef9866e820579a5 (patch)
tree1b5c0fed22f67fc8da884963791f9641e74cb67a /src
parent614577db033ba86235dbdced9403bb636f1b1dbf (diff)
parenta3da6744114f7e4df8945848717551648eac90e8 (diff)
Merge "Added admin user to people who can access bookings" into liblaas-mvp
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,