mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Fix search form for optional apps (like reddit)
This commit is contained in:
@@ -115,13 +115,13 @@ class UserLookupForm(forms.Form):
|
|||||||
(2, "Character"),
|
(2, "Character"),
|
||||||
(4, "Email Address"), ]
|
(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):
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(UserLookupForm, self).__init__(*args, **kwargs)
|
||||||
if installed('reddit'):
|
if installed('reddit'):
|
||||||
self.choices.append((3, "Reddit ID"))
|
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):
|
class APIPasswordForm(forms.Form):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user