diff --git a/apps/search/forms.py b/apps/search/forms.py index f809deee076..229465919dc 100644 --- a/apps/search/forms.py +++ b/apps/search/forms.py @@ -137,15 +137,18 @@ class _SearchForm(forms.Form): def clean(self): d = self.cleaned_data + raw = self.data # Set some defaults if not d.get('appid'): d['appid'] = request.APP.id - if 'cat' in d: - if ',' in d['cat']: - (d['atype'], d['cat']) = map(int, d['cat'].split(',')) - elif d['cat'] == 'all': + # Since not all categories are listed in this form, we use the raw + # data. + if 'cat' in raw: + if ',' in raw['cat']: + (d['atype'], d['cat']) = map(int, raw['cat'].split(',')) + elif raw['cat'] == 'all': d['cat'] = None if 'page' not in d or not d['page'] or d['page'] < 1: