Skip to content
Snippets Groups Projects
Commit a280376f authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Fixed userprofile.views.

parent b3831478
No related branches found
No related tags found
No related merge requests found
...@@ -29,15 +29,15 @@ def create(request): ...@@ -29,15 +29,15 @@ def create(request):
# Create the Trigger # Create the Trigger
t = Trigger(user=request.user) t = Trigger(user=request.user)
labels = form.cleaned_data['labels'] labels = form.cleaned_data['labels']
atypes = form.cleaned_data['atypes'] pipelines = form.cleaned_data['pipelines']
contacts = form.cleaned_data['contacts'] contacts = form.cleaned_data['contacts']
farThresh = form.cleaned_data['farThresh'] farThresh = form.cleaned_data['farThresh']
if contacts and (labels or atypes): if contacts and (labels or pipelines):
t.save() # Need an id before relations can be set. t.save() # Need an id before relations can be set.
try: try:
t.labels = labels t.labels = labels
t.atypes = atypes t.pipelines = pipelines
t.contacts = contacts t.contacts = contacts
t.farThresh = farThresh t.farThresh = farThresh
except: except:
...@@ -49,10 +49,10 @@ def create(request): ...@@ -49,10 +49,10 @@ def create(request):
try: try:
if not contacts: if not contacts:
message += "You must specify at least one contact. " message += "You must specify at least one contact. "
if not (labels or atypes): if not (labels or pipelines):
message += "You need to indicate label(s) and/or analysis type(s)." message += "You need to indicate label(s) and/or pipeline(s)."
except NameError: except NameError:
# form is not valid, so labels, contacts and atypes were not set. # form is not valid, so labels, contacts and pipelines were not set.
# hopefully, there are error messages in the form. # hopefully, there are error messages in the form.
pass pass
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment