Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A better fix to missing the release version.

  • Loading branch information...
commit 0c1d16a884ef5128f142507143be13394bef4415 1 parent 20e61b9
@jacobian jacobian authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 django_website/docs/forms.py
View
6 django_website/docs/forms.py
@@ -18,8 +18,10 @@ def __init__(self, *args, **kwargs):
def search(self):
sqs = super(DocSearchForm, self).search()
- rel = self.cleaned_data.get('release', DocumentRelease.objects.default())
- return sqs.filter(lang=rel.lang, version=rel.version)
+ if self.is_valid():
+ rel = self.cleaned_data['release']
+ sqs = sqs.filter(lang=rel.lang, version=rel.version)
+ return sqs
class DocumentReleaseChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):

0 comments on commit 0c1d16a

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