diff options
Diffstat (limited to 'python/fatcat_web/editing_routes.py')
-rw-r--r-- | python/fatcat_web/editing_routes.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/python/fatcat_web/editing_routes.py b/python/fatcat_web/editing_routes.py index f45c5379..a9b3d326 100644 --- a/python/fatcat_web/editing_routes.py +++ b/python/fatcat_web/editing_routes.py @@ -28,7 +28,7 @@ def form_editgroup_get_or_create(api, edit_form): if ae.status == 404: edit_form.editgroup_id.errors.append("Editgroup does not exist") return None - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # TODO: check here that editgroup hasn't been merged already else: @@ -37,7 +37,7 @@ def form_editgroup_get_or_create(api, edit_form): eg = api.create_editgroup( Editgroup(description=edit_form.editgroup_description.data or None)) except ApiException as ae: - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # set this session editgroup_id session['active_editgroup_id'] = eg.editgroup_id @@ -62,12 +62,12 @@ def container_create(): try: edit = user_api.create_container(entity, editgroup_id=eg.editgroup_id) except ApiException as ae: - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # redirect to new entity return redirect('/container/{}'.format(edit.ident)) elif form.errors: - app.logger.info("form errors (did not validate): {}".format(form.errors)) + app.log.info("form errors (did not validate): {}".format(form.errors)) else: editgroup_id = session.get('active_editgroup_id', None) form.editgroup_id.data = editgroup_id @@ -94,13 +94,13 @@ def container_edit(ident): edit = user_api.update_container(entity.ident, entity, editgroup_id=eg.editgroup_id) except ApiException as ae: - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # redirect to entity revision # TODO: container_rev_view return redirect('/container/{}'.format(edit.ident)) elif form.errors: - app.logger.info("form errors (did not validate): {}".format(form.errors)) + app.log.info("form errors (did not validate): {}".format(form.errors)) else: form = ContainerEntityForm.from_entity(entity) if not form.is_submitted(): @@ -131,12 +131,12 @@ def file_create(): try: edit = user_api.create_file(entity, editgroup_id=eg.editgroup_id) except ApiException as ae: - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # redirect to new entity return redirect('/file/{}'.format(edit.ident)) elif form.errors: - app.logger.info("form errors (did not validate): {}".format(form.errors)) + app.log.info("form errors (did not validate): {}".format(form.errors)) else: editgroup_id = session.get('active_editgroup_id', None) form.editgroup_id.data = editgroup_id @@ -166,13 +166,13 @@ def file_edit(ident): edit = user_api.update_file(entity.ident, entity, editgroup_id=eg.editgroup_id) except ApiException as ae: - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # redirect to entity revision # TODO: file_rev_view return redirect('/file/{}'.format(edit.ident)) elif form.errors: - app.logger.info("form errors (did not validate): {}".format(form.errors)) + app.log.info("form errors (did not validate): {}".format(form.errors)) else: # not submitted form = FileEntityForm.from_entity(entity) editgroup_id = session.get('active_editgroup_id', None) @@ -210,12 +210,12 @@ def release_create(): try: edit = user_api.create_release(entity, editgroup_id=eg.editgroup_id) except ApiException as ae: - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # redirect to new release return redirect('/release/{}'.format(edit.ident)) elif form.errors: - app.logger.info("form errors (did not validate): {}".format(form.errors)) + app.log.info("form errors (did not validate): {}".format(form.errors)) else: # not submitted form.contribs.append_entry() editgroup_id = session.get('active_editgroup_id', None) @@ -243,13 +243,13 @@ def release_edit(ident): edit = user_api.update_release(entity.ident, entity, editgroup_id=eg.editgroup_id) except ApiException as ae: - app.logger.warn(ae) + app.log.warn(ae) abort(ae.status) # redirect to entity revision # TODO: release_rev_view return redirect('/release/{}'.format(edit.ident)) elif form.errors: - app.logger.info("form errors (did not validate): {}".format(form.errors)) + app.log.info("form errors (did not validate): {}".format(form.errors)) else: # not submitted form = ReleaseEntityForm.from_entity(entity) editgroup_id = session.get('active_editgroup_id', None) |