fixed BUG-74 and 79 with new States model

This commit is contained in:
2022-01-20 17:37:37 +11:00
parent 78acb9bd66
commit 9ca24358d0
3 changed files with 9 additions and 6 deletions

View File

@@ -371,10 +371,13 @@ def files_rbp():
# be used even if the user hits the front/back buttons in the browser.
# func shows thumbnails of matching files.
################################################################################
@app.route("/search/<search_term>", methods=["GET"])
@app.route("/search/<search_term>", methods=["GET", "POST"])
@login_required
def search(search_term):
OPT=States( request )
# if we posted to get here, its a change in State, so save it to pa_user_state, and go back to the GET version or URL
if request.method=="POST":
redirect("/search/"+search_term)
OPT.search_term = search_term
# always show flat results for search to start with
OPT.folders=False