From 7253f583cf1fbb4dca778d9fd2d1e997f322a328 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Wed, 3 Oct 2018 21:18:08 +0200 Subject: [PATCH] Fix #650 Improved testablility Added feedback for book_edit -> stay on edit page --- cps/templates/detail.html | 2 +- cps/web.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 44c3619f..69e59aa5 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -60,7 +60,7 @@ {% endif %} -

{{entry.title|shortentitle(40)}}

+

{{entry.title|shortentitle(40)}}

{% for author in entry.authors %} {{author.name.replace('|',',')}} diff --git a/cps/web.py b/cps/web.py index 18f1f9e8..5d6e766c 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1752,6 +1752,8 @@ def authenticate_google_drive(): @app.route("/gdrive/callback") def google_drive_callback(): auth_code = request.args.get('code') + if not auth_code: + abort(403) try: credentials = gdriveutils.Gauth.Instance().auth.flow.step2_exchange(auth_code) with open(os.path.join(config.get_main_dir,'gdrive_credentials'), 'w') as f: @@ -3689,6 +3691,7 @@ def edit_book(book_id): if "detail_view" in to_save: return redirect(url_for('show_book', book_id=book.id)) else: + flash(_("Metadata successfully updated"), category="success") return render_edit_book(book_id) else: db.session.rollback()