Skip to content

Commit

Permalink
Add max_length param to search forms: bug 1286313
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmize committed Jul 12, 2016
1 parent 2ad2f0f commit ad0b1c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kitsune/search/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
from kitsune.wiki.config import CATEGORIES


MAX_QUERY_LENGTH = 200
SEARCH_LANGUAGES = [(k, LOCALES[k].native) for
k in settings.SUMO_LANGUAGES]


class SimpleSearchForm(forms.Form):
"""Django form to handle the simple search case."""
q = forms.CharField(required=True)
q = forms.CharField(required=True, max_length=MAX_QUERY_LENGTH)

w = forms.TypedChoiceField(required=False, coerce=int,
widget=forms.HiddenInput,
Expand Down Expand Up @@ -71,7 +72,7 @@ def clean_products(self):
class AdvancedSearchForm(forms.Form):
"""Django form for handling display and validation"""
# Common fields
q = forms.CharField(required=False)
q = forms.CharField(required=False, max_length=MAX_QUERY_LENGTH)

w = forms.TypedChoiceField(required=False, coerce=int,
widget=forms.HiddenInput,
Expand Down

0 comments on commit ad0b1c4

Please sign in to comment.