Commit 7253f583 authored by Ozzie Isaacs's avatar Ozzie Isaacs

Fix #650

Improved testablility
Added feedback for book_edit -> stay on edit page
parent 23633f16
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<h2>{{entry.title|shortentitle(40)}}</h2> <h2 id="title">{{entry.title|shortentitle(40)}}</h2>
<p class="author"> <p class="author">
{% for author in entry.authors %} {% for author in entry.authors %}
<a href="{{url_for('author', book_id=author.id ) }}">{{author.name.replace('|',',')}}</a> <a href="{{url_for('author', book_id=author.id ) }}">{{author.name.replace('|',',')}}</a>
......
...@@ -1752,6 +1752,8 @@ def authenticate_google_drive(): ...@@ -1752,6 +1752,8 @@ def authenticate_google_drive():
@app.route("/gdrive/callback") @app.route("/gdrive/callback")
def google_drive_callback(): def google_drive_callback():
auth_code = request.args.get('code') auth_code = request.args.get('code')
if not auth_code:
abort(403)
try: try:
credentials = gdriveutils.Gauth.Instance().auth.flow.step2_exchange(auth_code) credentials = gdriveutils.Gauth.Instance().auth.flow.step2_exchange(auth_code)
with open(os.path.join(config.get_main_dir,'gdrive_credentials'), 'w') as f: with open(os.path.join(config.get_main_dir,'gdrive_credentials'), 'w') as f:
...@@ -3689,6 +3691,7 @@ def edit_book(book_id): ...@@ -3689,6 +3691,7 @@ def edit_book(book_id):
if "detail_view" in to_save: if "detail_view" in to_save:
return redirect(url_for('show_book', book_id=book.id)) return redirect(url_for('show_book', book_id=book.id))
else: else:
flash(_("Metadata successfully updated"), category="success")
return render_edit_book(book_id) return render_edit_book(book_id)
else: else:
db.session.rollback() db.session.rollback()
......
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