Add Django migrations.
[django-cas-provider.git] / cas_provider / forms.py
1 from django import forms
2 from django.utils.translation import ugettext_lazy as _
3
4
5 class LoginForm(forms.Form):
6     username = forms.CharField(widget=forms.TextInput(attrs={'autofocus': 'autofocus',
7                                                           'max_length': '255'}),
8                                label=_('Username'))
9     password = forms.CharField(widget=forms.PasswordInput(), label=_('Password'))
10     service = forms.CharField(widget=forms.HiddenInput, required=False)
11
12     def __init__(self, *args, **kwargs):
13         # renew = kwargs.pop('renew', None)
14         # gateway = kwargs.pop('gateway', None)
15         request = kwargs.pop('request', None)
16         super(LoginForm, self).__init__(*args, **kwargs)
17         self.request = request
18
19
20 class MergeLoginForm(LoginForm):
21     username = forms.CharField(max_length=255, widget=forms.HiddenInput,
22                                label=_('Username'))