Browse Source

Better error message on empty search form.

Ralfp 12 years ago
parent
commit
dfb40aef54
1 changed files with 2 additions and 1 deletions
  1. 2 1
      misago/apps/search/forms.py

+ 2 - 1
misago/apps/search/forms.py

@@ -4,7 +4,8 @@ from django.utils.translation import ungettext_lazy, ugettext_lazy as _
 from misago.forms import Form
 from misago.forms import Form
 
 
 class QuickSearchForm(Form):
 class QuickSearchForm(Form):
-    search_query = forms.CharField(max_length=255)
+    search_query = forms.CharField(max_length=255,
+                                   error_messages={'required': _("You have to enter search query.")})
 
 
     def clean_search_query(self):
     def clean_search_query(self):
         data = self.cleaned_data['search_query']
         data = self.cleaned_data['search_query']