Revision 062c970c snf-astakos-app/astakos/im/forms.py
b/snf-astakos-app/astakos/im/forms.py | ||
---|---|---|
145 | 145 |
|
146 | 146 |
class InvitedLocalUserCreationForm(LocalUserCreationForm): |
147 | 147 |
""" |
148 |
Extends the LocalUserCreationForm: adds an inviter readonly field.
|
|
148 |
Extends the LocalUserCreationForm: email is readonly.
|
|
149 | 149 |
""" |
150 |
|
|
151 |
inviter = forms.CharField(widget=forms.TextInput(), label=_('Inviter Real Name')) |
|
152 |
|
|
153 | 150 |
class Meta: |
154 | 151 |
model = AstakosUser |
155 | 152 |
fields = ("email", "first_name", "last_name", "has_signed_terms") |
... | ... | |
162 | 159 |
super(InvitedLocalUserCreationForm, self).__init__(*args, **kwargs) |
163 | 160 |
|
164 | 161 |
#set readonly form fields |
165 |
ro = ('inviter', 'email', 'username',)
|
|
162 |
ro = ('email', 'username',) |
|
166 | 163 |
for f in ro: |
167 | 164 |
self.fields[f].widget.attrs['readonly'] = True |
168 | 165 |
|
... | ... | |
231 | 228 |
|
232 | 229 |
class InvitedThirdPartyUserCreationForm(ThirdPartyUserCreationForm): |
233 | 230 |
""" |
234 |
Extends the LocalUserCreationForm: adds an inviter readonly field.
|
|
231 |
Extends the ThirdPartyUserCreationForm: email is readonly.
|
|
235 | 232 |
""" |
236 |
inviter = forms.CharField(widget=forms.TextInput(), label=_('Inviter Real Name')) |
|
237 |
|
|
238 | 233 |
def __init__(self, *args, **kwargs): |
239 | 234 |
""" |
240 | 235 |
Changes the order of fields, and removes the username field. |
... | ... | |
242 | 237 |
super(InvitedThirdPartyUserCreationForm, self).__init__(*args, **kwargs) |
243 | 238 |
|
244 | 239 |
#set readonly form fields |
245 |
ro = ('inviter', 'email',)
|
|
240 |
ro = ('email',) |
|
246 | 241 |
for f in ro: |
247 | 242 |
self.fields[f].widget.attrs['readonly'] = True |
248 | 243 |
|
Also available in: Unified diff