1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-26 10:00:37 +00:00

Fix for #1660 (Pagination in advanced search not working, error 500 for no filter in advanced search)

Fix #1666 (Pagination in search not working)
This commit is contained in:
Ozzieisaacs 2020-10-16 19:56:24 +02:00
parent e8620a0986
commit 2814617e4b

View File

@ -1231,7 +1231,9 @@ def reconnect():
def search(): def search():
term = request.args.get("query") term = request.args.get("query")
if term: if term:
return render_search_results(term, 0, None, config.config_books_per_page) # flask_session['query'] = json.dumps(request.form)
return redirect(url_for('web.books_list', data="search", sort_param='stored', query=term))
# return render_search_results(term, 0, None, config.config_books_per_page)
else: else:
return render_title_template('search.html', return render_title_template('search.html',
searchterm="", searchterm="",
@ -1243,8 +1245,9 @@ def search():
@web.route("/advanced_search", methods=['POST']) @web.route("/advanced_search", methods=['POST'])
@login_required_if_no_ano @login_required_if_no_ano
def advanced_search(): def advanced_search():
term = request.form flask_session['query'] = json.dumps(request.form)
return render_adv_search_results(term, 0, None, config.config_books_per_page) return redirect(url_for('web.books_list', data="advsearch", sort_param='stored', query=""))
def render_adv_search_results(term, offset=None, order=None, limit=None): def render_adv_search_results(term, offset=None, order=None, limit=None):
order = order or [db.Books.sort] order = order or [db.Books.sort]