Skip to content

Commit

Permalink
So here's to you, Mr. URL-By-Hand-Constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobian committed Feb 1, 2011
1 parent 82276c1 commit eb33112
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_website/docs/forms.py
Expand Up @@ -14,12 +14,13 @@ def __init__(self, *args, **kwargs):
queryset = DocumentRelease.objects.all().order_by('version'),
initial = DocumentRelease.objects.default(),
empty_label = None,
required = False,
)

def search(self):
sqs = super(DocSearchForm, self).search()
if self.is_valid():
rel = self.cleaned_data['release']
rel = self.cleaned_data['release'] or DocumentRelease.objects.default()
sqs = sqs.filter(lang=rel.lang, version=rel.version)
return sqs

Expand Down

0 comments on commit eb33112

Please sign in to comment.