diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2018-11-20 11:19:55 -0500 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2018-11-26 14:14:10 -0500 |
commit | b361d6df77ab59bb0f227aec00c19b080f31bc50 (patch) | |
tree | 0aa043dcd4701ab22385b2eca2e783f27de687fd /src/notifier | |
parent | b7c4d286ffa618be0e95b15f3883e2f6920a3fb1 (diff) |
Fixed Misc Bugs
Some corner cases that cause issues recently came to our attention.
Fixes issues in the booking workflow and the Notification system.
Change-Id: Ie16118ba1bdbeff86bb41a16dc783337b921d527
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/notifier')
-rw-r--r-- | src/notifier/manager.py | 4 | ||||
-rw-r--r-- | src/notifier/views.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/notifier/manager.py b/src/notifier/manager.py index a754241..3361074 100644 --- a/src/notifier/manager.py +++ b/src/notifier/manager.py @@ -45,7 +45,7 @@ class NotificationHandler(object): } ) ) - owner_notif.recipients.add(booking.owner) + owner_notif.recipients.add(booking.owner.userprofile) if not booking.collaborators.all().exists(): return # no collaborators - were done @@ -60,7 +60,7 @@ class NotificationHandler(object): ) ) for c in booking.collaborators.all(): - collab_notif.recipients.add(c) + collab_notif.recipients.add(c.userprofile) @classmethod def email_job_fulfilled(cls, job): diff --git a/src/notifier/views.py b/src/notifier/views.py index c1a2f7e..4ee757f 100644 --- a/src/notifier/views.py +++ b/src/notifier/views.py @@ -17,7 +17,7 @@ def InboxView(request): else: return render(request, "dashboard/login.html", {'title': 'Authentication Required'}) - return render(request, "notifier/inbox.html", {'notifications': Notification.objects.filter(recipient=user.userprofile)}) + return render(request, "notifier/inbox.html", {'notifications': Notification.objects.filter(recipients=user.userprofile)}) def NotificationView(request, notification_id): @@ -27,7 +27,7 @@ def NotificationView(request, notification_id): return render(request, "dashboard/login.html", {'title': 'Authentication Required'}) notification = Notification.objects.get(id=notification_id) - if user not in notification.recipients: + if user.userprofile not in notification.recipients.all(): return render(request, "dashboard/login.html", {'title': 'Access Denied'}) return render(request, "notifier/notification.html", {'notification': notification}) |