Commit e904cf9a authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Fix for notification edit view with label queries

parent d0342e36
...@@ -101,6 +101,12 @@ class EditNotificationView(UpdateView): ...@@ -101,6 +101,12 @@ class EditNotificationView(UpdateView):
kw = super(EditNotificationView, self).get_form_kwargs( kw = super(EditNotificationView, self).get_form_kwargs(
*args, **kwargs) *args, **kwargs)
kw['user'] = self.request.user kw['user'] = self.request.user
# Cases that have a label query actually have labels in the database.
# But we don't want to include those in the form because
# a) it's confusing and b) it breaks the form
if self.object.label_query and self.object.labels.exists():
kw['initial']['labels'] = None
return kw return kw
def get_queryset(self): def get_queryset(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment