Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Init release dropdown in search form with currently shown ver…

…sion value."

This reverts commit 396f5ba.
  • Loading branch information...
commit de47929ee0a406f659faefd9de51de9653ea0c83 1 parent 483ce6b
@jezdez jezdez authored
View
10 django_website/docs/forms.py
@@ -7,16 +7,12 @@
class DocSearchForm(haystack.forms.SearchForm):
- def __init__(self, version, *args, **kwargs):
+ def __init__(self, *args, **kwargs):
super(DocSearchForm, self).__init__(*args, **kwargs)
self.fields['q'].widget = SearchInput()
- try:
- rel = DocumentRelease.objects.get(version=version)
- except DocumentRelease.DoesNotExist:
- rel = DocumentRelease.objects.default()
self.fields['release'] = DocumentReleaseChoiceField(
queryset = DocumentRelease.objects.all().order_by('version'),
- initial = rel,
+ initial = DocumentRelease.objects.default(),
empty_label = None,
required = False,
)
@@ -33,4 +29,4 @@ def label_from_instance(self, obj):
return obj.human_version
class SearchInput(forms.TextInput):
- input_type = 'search'
+ input_type = 'search'
View
3  django_website/docs/templatetags/docs.py
@@ -10,10 +10,9 @@
@register.inclusion_tag('docs/search_form.html', takes_context=True)
def search_form(context, search_form_id='sidebar_search'):
request = context['request']
- version = context['version']
auto_id = 'id_%s_%%s' % search_form_id
return {
- 'form': DocSearchForm(version, initial=request.GET, auto_id=auto_id),
+ 'form': DocSearchForm(initial=request.GET, auto_id=auto_id),
'search_form_id': search_form_id,
}
Please sign in to comment.
Something went wrong with that request. Please try again.