diff options
author | Trevor Bramwell <tbramwell@linuxfoundation.org> | 2018-10-31 21:34:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-10-31 21:34:01 +0000 |
commit | a47d02fb4cb97f92fa568302ced8bfd38526f967 (patch) | |
tree | 24f2d63de469d7bcb4dcae212448b20307875724 /src/booking/views.py | |
parent | f05d748b932486adac4074cf56780a55de9e6e99 (diff) | |
parent | 6c22b5efaca347cdd51f1e23b28a246c77736aed (diff) |
Merge "Hides information about your booking from other users"
Diffstat (limited to 'src/booking/views.py')
-rw-r--r-- | src/booking/views.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/booking/views.py b/src/booking/views.py index 9b9860f..a0ea31d 100644 --- a/src/booking/views.py +++ b/src/booking/views.py @@ -103,6 +103,10 @@ def booking_detail_view(request, booking_id): return render(request, "dashboard/login.html", {'title': 'Authentication Required'}) booking = get_object_or_404(Booking, id=booking_id) + allowed_users = set(list(booking.collaborators.all())) + allowed_users.add(booking.owner) + if user not in allowed_users: + return render(request, "dashboard/login.html", {'title': 'This page is private'}) return render(request, "booking/booking_detail.html", { 'title': 'Booking Details', 'booking': booking, |