Fixed a possible KeyError bug for missing form field 'by'.

- Legacy-Id: 6045
This commit is contained in:
Henrik Levkowetz 2013-08-13 12:43:53 +00:00
parent e46220af5d
commit 551f61b55a

View file

@ -94,6 +94,8 @@ class SearchForm(forms.Form):
q['by'] = None
if q['by'] == 'state' and not (q.get("state") or q.get('substate')):
q['by'] = None
else:
q['by'] = None
# Reset other fields
for k in ('author','group', 'area', 'ad'):
if k != q['by']: