Commit 99b417cf authored by Ryan Herbert's avatar Ryan Herbert
Browse files

file.py hackiness for error return isEditing

insert the form action earlier in case set validation fails
parent 81f717a2
Pipeline #19927 passed with stages
in 42 seconds
...@@ -212,6 +212,12 @@ def submit(): ...@@ -212,6 +212,12 @@ def submit():
data['errors'] = errors data['errors'] = errors
if (f["id"] != ""):
action = 'edit'
else:
action = 'add'
data['action'] = action
if len(errors) > 0: if len(errors) > 0:
return form_response(data) return form_response(data)
...@@ -247,7 +253,6 @@ def submit(): ...@@ -247,7 +253,6 @@ def submit():
f['id'] = fid = db.sequence_file.insert(**file_data) f['id'] = fid = db.sequence_file.insert(**file_data)
action = "add" action = "add"
data['action'] = action
f['message'] = [] f['message'] = []
mes = "file (%d) %s %sed" % (int(f["id"]), f["filename"], action) mes = "file (%d) %s %sed" % (int(f["id"]), f["filename"], action)
f['message'].append(mes) f['message'].append(mes)
......
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