From b68391bed67266f935e86841b42846a7574011f4 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 20 Dec 2010 14:49:38 +0000 Subject: [PATCH] Fix search form for optional apps (like reddit) --- sso/forms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sso/forms.py b/sso/forms.py index 00b6ca9..c31e80a 100644 --- a/sso/forms.py +++ b/sso/forms.py @@ -115,13 +115,13 @@ class UserLookupForm(forms.Form): (2, "Character"), (4, "Email Address"), ] - type = forms.ChoiceField(label = u'Search type', choices = choices) - username = forms.CharField(label = u'User ID', max_length=64) - def __init__(self, *args, **kwargs): + super(UserLookupForm, self).__init__(*args, **kwargs) if installed('reddit'): self.choices.append((3, "Reddit ID")) - forms.Form.__init__(self, *args, **kwargs) + + self.fields['type'] = forms.ChoiceField(label=u'Search type', choices=self.choices) + self.fields['username'] = forms.CharField(label = u'User ID', max_length=64) class APIPasswordForm(forms.Form):