Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix hasty refactoring.

  • Loading branch information...
commit 10f08284782f311b55753f9762bdc6d832497dcc 1 parent 01e9918
@aaugustin aaugustin authored
Showing with 5 additions and 5 deletions.
  1. +2 −2 docs/forms.py
  2. +3 −3 docs/views.py
View
4 docs/forms.py
@@ -8,7 +8,7 @@
class DocSearchForm(haystack.forms.SearchForm):
def __init__(self, *args, **kwargs):
- initial_rel = kwargs.pop('release', DocumentRelease.objects.default())
+ initial_rel = kwargs.pop('release', DocumentRelease.objects.current())
super(DocSearchForm, self).__init__(*args, **kwargs)
self.fields['q'].widget = SearchInput()
self.fields['release'] = DocumentReleaseChoiceField(
@@ -21,7 +21,7 @@ def __init__(self, *args, **kwargs):
def search(self):
sqs = super(DocSearchForm, self).search()
if self.is_valid():
- rel = self.cleaned_data['release'] or DocumentRelease.objects.default()
+ rel = self.cleaned_data['release'] or DocumentRelease.objects.current()
sqs = sqs.filter(lang=rel.lang, version=rel.version)
return sqs
View
6 docs/views.py
@@ -17,10 +17,10 @@
def index(request):
- return redirect(DocumentRelease.objects.default())
+ return redirect(DocumentRelease.objects.current())
def language(request, lang):
- return redirect(DocumentRelease.objects.default())
+ return redirect(DocumentRelease.objects.current())
def stable(request, lang, version, url):
path = request.get_full_path()
@@ -101,7 +101,7 @@ def __init__(self, **kwargs):
def extra_context(self):
# Constuct a context that matches the rest of the doc page views.
- default_release = DocumentRelease.objects.default()
+ default_release = DocumentRelease.objects.current()
return {
'lang': default_release.lang,
'version': default_release.version,

0 comments on commit 10f0828

Please sign in to comment.
Something went wrong with that request. Please try again.