From 4550333f1e150a46db7c5a84280dde6fbf9fba16 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Thu, 2 Apr 2020 20:18:24 +0200 Subject: [PATCH] Added redirect after create shelf --- cps/opds.py | 7 +------ cps/shelf.py | 1 + cps/templates/layout.html | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cps/opds.py b/cps/opds.py index c9721a8a..5cfb5348 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -310,17 +310,12 @@ def feed_languages(book_id): return render_xml_template('feed.xml', entries=entries, pagination=pagination) -@opds.route("/opds/shelfindex") #, defaults={'public': 0}) -# @opds.route("/opds/shelfindex/") +@opds.route("/opds/shelfindex") @requires_basic_auth_if_no_ano def feed_shelfindex(): off = request.args.get("offset") or 0 - # if public != 0: shelf = g.shelves_access number = len(shelf) - #else: - #shelf = g.user.shelf - # number = shelf.count() pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page, number) return render_xml_template('feed.xml', listelements=shelf, folder='opds.feed_shelf', pagination=pagination) diff --git a/cps/shelf.py b/cps/shelf.py index 02e910eb..d299fdfb 100644 --- a/cps/shelf.py +++ b/cps/shelf.py @@ -226,6 +226,7 @@ def create_shelf(): ub.session.add(shelf) ub.session.commit() flash(_(u"Shelf %(title)s created", title=to_save["title"]), category="success") + return redirect(url_for('shelf.show_shelf', shelf_id = shelf.id )) except Exception: flash(_(u"There was an error"), category="error") return render_title_template('shelf_edit.html', shelf=shelf, title=_(u"create a shelf"), page="shelfcreate") diff --git a/cps/templates/layout.html b/cps/templates/layout.html index e32976f2..559eeabc 100644 --- a/cps/templates/layout.html +++ b/cps/templates/layout.html @@ -125,8 +125,6 @@