Considering that `query` is not mandatory, can it be that the form is valid, with `self.cleaned_data['query'] == None`? Basically, is `clean_query()` ever executed even though `query` is None?