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 | 5346a9f8f74c4a59d6422d5d8c9f2ed3e2fa6cf8 (patch) | |
tree | 7dd7e3b2396d5837b37a5c6618d47ba9fa0cd57f /dashboard | |
parent | c974df4aed35ed932e485a477d5beb289a18ad8a (diff) | |
parent | f53ba6c4db78bb1ddfc6eb72938d688b5970f284 (diff) |
Merge "Hides information about your booking from other users"
Diffstat (limited to 'dashboard')
-rw-r--r-- | dashboard/src/booking/views.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dashboard/src/booking/views.py b/dashboard/src/booking/views.py index 9b9860f..a0ea31d 100644 --- a/dashboard/src/booking/views.py +++ b/dashboard/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, |