Revert "post" as search request. Search request is now get again (fix for #2741)

Revert "Auxiliary commit to revert individual files from 275675b48add79d2bbce06426cc1224c5e2c1bfb"

This reverts commit 6c920bc49f133d5c7451230448121f1f8b3cd9f2.
This commit is contained in:
Ozzie Isaacs 2023-04-12 18:24:33 +02:00
parent 13c0d30a8f
commit 592216588c
3 changed files with 5 additions and 7 deletions

View File

@ -35,13 +35,12 @@ search = Blueprint('search', __name__)
log = logger.create()
@search.route("/search", methods=["POST"])
@search.route("/search", methods=["GET"])
@login_required_if_no_ano
def simple_search():
term = dict(request.form).get("query")
term = request.args.get("query")
if term:
flask_session['query'] = json.dumps(term.strip())
return redirect(url_for('web.books_list', data="search", sort_param='stored', query="")) # term.strip()
return redirect(url_for('web.books_list', data="search", sort_param='stored', query=term.strip()))
else:
return render_title_template('search.html',
searchterm="",

View File

@ -41,8 +41,7 @@
<div class="plexBack"><a href="{{url_for('web.index')}}"></a></div>
{% endif %}
{% if current_user.is_authenticated or g.allow_anonymous %}
<form class="navbar-form navbar-left" role="search" action="{{url_for('search.simple_search')}}" method="POST">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<form class="navbar-form navbar-left" role="search" action="{{url_for('search.simple_search')}}" method="GET">
<div class="form-group input-group input-group-sm">
<label for="query" class="sr-only">{{_('Search')}}</label>
<input type="text" class="form-control" id="query" name="query" placeholder="{{_('Search Library')}}" value="{{searchterm}}">

View File

@ -396,7 +396,7 @@ def render_books_list(data, sort_param, book_id, page):
elif data == "archived":
return render_archived_books(page, order)
elif data == "search":
term = json.loads(flask_session.get('query', ''))
term = (request.args.get('query') or '')
offset = int(int(config.config_books_per_page) * (page - 1))
return render_search_results(term, offset, order, config.config_books_per_page)
elif data == "advsearch":