diff options
author | Martin Czygan <martin@archive.org> | 2020-07-06 18:53:24 +0000 |
---|---|---|
committer | Martin Czygan <martin@archive.org> | 2020-07-06 18:53:24 +0000 |
commit | 68cf95bd1d1588c0d3170b4032596756e07ae718 (patch) | |
tree | 3163a803dd6743c84c83a786b5aea7eda3bbca8e /python/fatcat_web/editing_routes.py | |
parent | bea909f997bcef51e2624b9eea42c8fbe7115aaa (diff) | |
parent | 8583c6866f2bb89e8dfe5f5e5893048c2fd854e7 (diff) | |
download | fatcat-68cf95bd1d1588c0d3170b4032596756e07ae718.tar.gz fatcat-68cf95bd1d1588c0d3170b4032596756e07ae718.zip |
Merge branch 'bnewbold-lint' into 'master'
lint cleanups
See merge request webgroup/fatcat!62
Diffstat (limited to 'python/fatcat_web/editing_routes.py')
-rw-r--r-- | python/fatcat_web/editing_routes.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/python/fatcat_web/editing_routes.py b/python/fatcat_web/editing_routes.py index 87223868..44000b1a 100644 --- a/python/fatcat_web/editing_routes.py +++ b/python/fatcat_web/editing_routes.py @@ -1,16 +1,11 @@ -import os -import json -from flask import Flask, render_template, send_from_directory, request, \ - url_for, abort, g, redirect, jsonify, session, flash, Response +from flask import render_template, abort, redirect, session, flash from flask_login import login_required from fatcat_openapi_client import Editgroup from fatcat_openapi_client.rest import ApiException from fatcat_tools.transforms import * -from fatcat_web import app, api, auth_api, priv_api -from fatcat_web.auth import handle_token_login, handle_logout, load_user, handle_ia_xauth -from fatcat_web.cors import crossdomain +from fatcat_web import app, api, auth_api from fatcat_web.search import * from fatcat_web.forms import * from fatcat_web.entity_helpers import * @@ -20,7 +15,7 @@ from fatcat_web.entity_helpers import * def form_editgroup_get_or_create(api, edit_form): """ - This function expects a submitted, validated + This function expects a submitted, validated edit form """ if edit_form.editgroup_id.data: try: @@ -43,8 +38,10 @@ def form_editgroup_get_or_create(api, edit_form): app.log.warning(ae) abort(ae.status) # set this session editgroup_id - flash('Started new editgroup <a href="/editgroup/{}">{}</a>' \ - .format(eg.editgroup_id, eg.editgroup_id)) + flash('Started new editgroup <a href="/editgroup/{}">{}</a>'.format( + eg.editgroup_id, + eg.editgroup_id, + )) return eg def generic_entity_edit(editgroup_id, entity_type, existing_ident, edit_template): @@ -68,7 +65,7 @@ def generic_entity_edit(editgroup_id, entity_type, existing_ident, edit_template Helpers: - get_editgroup_revision(editgroup, entity_type, ident) -> None or entity - + TODO: prev_rev interlock """ @@ -214,7 +211,7 @@ def generic_edit_delete(editgroup_id, entity_type, edit_id): # API on behalf of user user_api = auth_api(session['api_token']) - + # do the deletion try: if entity_type == 'container': @@ -358,4 +355,3 @@ def work_editgroup_edit(editgroup_id, ident): @app.route('/editgroup/<editgroup_id>/work/edit/<edit_id>/delete', methods=['POST']) def work_edit_delete(editgroup_id, edit_id): return abort(404) - |