From 3495bdfef2a3566c0545d09ec3ded6675fe80091 Mon Sep 17 00:00:00 2001 From: James Meneghello Date: Tue, 5 Jan 2016 11:18:27 +0800 Subject: [PATCH] fix #250: fix an api bug when no cats are selected --- pynab/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pynab/api.py b/pynab/api.py index a0f0d6a..ed9f0b9 100644 --- a/pynab/api.py +++ b/pynab/api.py @@ -197,7 +197,8 @@ def search(dataset=None): # get categories if not cat_ids: cats = request.query.cat or None - cat_ids = cats.split(',') + if cats: + cat_ids = cats.split(',') if cat_ids: query = query.join(Category).filter(Category.id.in_(cat_ids) | Category.parent_id.in_(cat_ids))