# HG changeset patch # User Brian Neal # Date 1433384023 18000 # Node ID 76ee6403e03355faf167ad80124935995d228bb8 # Parent 71a671dab55d0a734fc881cbf7e9dbe81818d98d# Parent 6cc9221d04a7eac4dc73859753599d8e2daf987d Merge with main line. diff -r 71a671dab55d -r 76ee6403e033 custom_search/forms.py --- a/custom_search/forms.py Wed Jun 03 21:13:08 2015 -0500 +++ b/custom_search/forms.py Wed Jun 03 21:13:43 2015 -0500 @@ -54,13 +54,17 @@ label='Search in', widget=forms.CheckboxSelectMultiple) def clean(self): + super(CustomModelSearchForm, self).clean() if not settings.SEARCH_QUEUE_ENABLED: raise forms.ValidationError("Our search function is offline for " "maintenance. Please try again later. " "We apologize for any inconvenience.") - if not (self.cleaned_data['q'] or self.cleaned_data['exact'] or - self.cleaned_data['exclude']): + q = self.cleaned_data.get('q') + exact = self.cleaned_data.get('exact') + exclude = self.cleaned_data.get('exclude') + + if not (q or exact or exclude): raise forms.ValidationError('Please supply some search terms') return self.cleaned_data