This commit is contained in:
Ozzieisaacs 2018-11-28 18:28:55 +01:00
parent 64b1b830d6
commit 7526b0dcb4

View File

@ -1482,19 +1482,15 @@ def series_list():
@app.route("/series/<int:book_id>/", defaults={'page': 1}) @app.route("/series/<int:book_id>/", defaults={'page': 1})
@app.route("/series/<int:book_id>/<int:page>'") @app.route("/series/<int:book_id>/<int:page>")
@login_required_if_no_ano @login_required_if_no_ano
def series(book_id, page): def series(book_id, page):
name = db.session.query(db.Series).filter(db.Series.id == book_id).first() name = db.session.query(db.Series).filter(db.Series.id == book_id).first()
if name: if name:
entries, random, pagination = fill_indexpage(page, db.Books, db.Books.series.any(db.Series.id == book_id), entries, random, pagination = fill_indexpage(page, db.Books, db.Books.series.any(db.Series.id == book_id),
[db.Books.series_index]) [db.Books.series_index])
if entries: return render_title_template('index.html', random=random, pagination=pagination, entries=entries,
return render_title_template('index.html', random=random, pagination=pagination, entries=entries,
title=_(u"Series: %(serie)s", serie=name.name), page="series") title=_(u"Series: %(serie)s", serie=name.name), page="series")
else:
flash(_(u"Error opening eBook. File does not exist or file is not accessible:"), category="error")
return redirect(url_for("index"))
else: else:
abort(404) abort(404)