From 1cc615d0835be011bebe8884c802e90f227fb83e Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Sat, 12 Dec 2015 00:14:43 +0000 Subject: [PATCH] Fixed error if user_items was missing query string elements. --- wanikaniburned.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wanikaniburned.py b/wanikaniburned.py index be7432a..2f2696d 100644 --- a/wanikaniburned.py +++ b/wanikaniburned.py @@ -186,13 +186,13 @@ def show_quiz(): @login_required def get_items(): level_range = list(range(0, 61)) - if flask.request.args.get('level_range') is not '': + if flask.request.args.get('level_range') and flask.request.args.get('level_range') is not '': level_range = parse_range(flask.request.args.get('level_range')) item_state = ['burned'] - if flask.request.args.get('item_state') is not '': + if flask.request.args.get('item_state') and flask.request.args.get('item_state') is not '': item_state = flask.request.args.get('item_state').split(',') item_types = ['radical', 'kanji', 'vocab'] - if flask.request.args.get('item_types') is not '': + if flask.request.args.get('item_types') and flask.request.args.get('item_types') is not '': item_types = flask.request.args.get('item_types').split(',') return get_items_with_level_restriction(level_range, item_state, item_types)