Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

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/
6 django_website/docs/
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.