fix tag filtering

This commit is contained in:
2017-10-19 13:20:44 +02:00
parent f3ec15f93f
commit 680f3f66d0
3 changed files with 21 additions and 11 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ async def show_cardlist(request, template={}):
c.copies_owned = int(c.copies_owned) - 1
cards = card.from_dir(config.carddir)
sorting_key = None
sorting_key = ""
if "sort" in request.args:
sorting_key = request.args["sort"][0]
if "sort" in request.form:
@@ -43,8 +43,8 @@ async def show_cardlist(request, template={}):
cards = sorted(cards, key=lambda x: x.title.lower())
elif sorting_key == "tag":
cards = sorted(cards, key=lambda x: x.tag or "\0")
filter_key = None
filter_key = ""
if "filter" in request.args:
filter_key = request.args["filter"][0]
if "filter" in request.form: