From 753a0a82a13dcfd92ec05d054b6d7082bd364d52 Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Mon, 3 Oct 2016 12:08:34 +0200 Subject: [PATCH] Fix for #66 advanced search --- cps/web.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cps/web.py b/cps/web.py index 5f64bf60..6ef8c0cd 100755 --- a/cps/web.py +++ b/cps/web.py @@ -489,8 +489,10 @@ def advanced_search(): q = db.session.query(db.Books) include_tag_inputs = request.args.getlist('include_tag') exclude_tag_inputs = request.args.getlist('exclude_tag') - author_name = request.args.get("author_name").strip() - book_title = request.args.get("book_title").strip() + author_name = request.args.get("author_name") + book_title = request.args.get("book_title") + if author_name: author_name=author_name.strip() + if book_title : book_title=book_title.strip() if include_tag_inputs or exclude_tag_inputs or author_name or book_title: searchterm = [] searchterm.extend((author_name, book_title))