aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/editing_routes.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/fatcat_web/editing_routes.py')
-rw-r--r--python/fatcat_web/editing_routes.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/python/fatcat_web/editing_routes.py b/python/fatcat_web/editing_routes.py
index 29db3443..98e5c27d 100644
--- a/python/fatcat_web/editing_routes.py
+++ b/python/fatcat_web/editing_routes.py
@@ -30,7 +30,9 @@ def form_editgroup_get_or_create(api, edit_form):
return None
app.log.warning(ae)
abort(ae.status)
- # TODO: check here that editgroup hasn't been merged already
+ if eg.changelog_index:
+ edit_form.editgroup_id.errors.append("Editgroup has already been accepted")
+ return None
else:
# if no editgroup, create one from description
try:
@@ -67,6 +69,8 @@ def container_create():
abort(ae.status)
# redirect to new entity
return redirect('/container/{}'.format(edit.ident))
+ else:
+ status = 400
elif form.errors:
status = 400
app.log.info("form errors (did not validate): {}".format(form.errors))
@@ -102,6 +106,8 @@ def container_edit(ident):
# redirect to entity revision
# TODO: container_rev_view
return redirect('/container/{}'.format(edit.ident))
+ else:
+ status = 400
elif form.errors:
status = 400
app.log.info("form errors (did not validate): {}".format(form.errors))
@@ -144,6 +150,8 @@ def file_create():
abort(ae.status)
# redirect to new entity
return redirect('/file/{}'.format(edit.ident))
+ else:
+ status = 400
elif form.errors:
status = 400
app.log.info("form errors (did not validate): {}".format(form.errors))
@@ -181,6 +189,8 @@ def file_edit(ident):
# redirect to entity revision
# TODO: file_rev_view
return redirect('/file/{}'.format(edit.ident))
+ else:
+ status = 400
elif form.errors:
status = 400
app.log.info("form errors (did not validate): {}".format(form.errors))
@@ -234,6 +244,8 @@ def release_create():
abort(ae.status)
# redirect to new release
return redirect('/release/{}'.format(edit.ident))
+ else:
+ status = 400
elif form.errors:
status = 400
app.log.info("form errors (did not validate): {}".format(form.errors))
@@ -270,6 +282,8 @@ def release_edit(ident):
# redirect to entity revision
# TODO: release_rev_view
return redirect('/release/{}'.format(edit.ident))
+ else:
+ status = 400
elif form.errors:
status = 400
app.log.info("form errors (did not validate): {}".format(form.errors))