Revision a1d151a8 snf-astakos-app/astakos/im/forms.py
b/snf-astakos-app/astakos/im/forms.py | ||
---|---|---|
245 | 245 |
|
246 | 246 |
class Meta: |
247 | 247 |
model = AstakosUser |
248 |
fields = ['id', 'email', 'third_party_identifier', 'first_name', 'last_name'] |
|
248 |
fields = ['id', 'email', 'third_party_identifier', |
|
249 |
'first_name', 'last_name', 'has_signed_terms'] |
|
249 | 250 |
|
250 | 251 |
def __init__(self, *args, **kwargs): |
251 | 252 |
""" |
... | ... | |
255 | 256 |
if self.request: |
256 | 257 |
kwargs.pop('request') |
257 | 258 |
|
258 |
latest_terms = get_latest_terms() |
|
259 |
if latest_terms: |
|
260 |
self._meta.fields.append('has_signed_terms') |
|
261 |
|
|
262 | 259 |
super(ThirdPartyUserCreationForm, self).__init__(*args, **kwargs) |
263 | 260 |
|
264 |
if latest_terms: |
|
265 |
self.fields.keyOrder.append('has_signed_terms') |
|
266 |
|
|
267 | 261 |
if 'has_signed_terms' in self.fields: |
268 | 262 |
# Overriding field label since we need to apply a link |
269 | 263 |
# to the terms within the label |
Also available in: Unified diff