Skip to content

Commit

Permalink
Use the default release if it isn't in the form.
Browse files Browse the repository at this point in the history
This happens with manual querystring hacking sometimes.
  • Loading branch information
jacobian committed Feb 1, 2011
1 parent 821f1ef commit 20e61b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_website/docs/forms.py
Expand Up @@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):

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

class DocumentReleaseChoiceField(forms.ModelChoiceField):
Expand Down

0 comments on commit 20e61b9

Please sign in to comment.