Revision bebd2649 snf-astakos-app/astakos/im/forms.py

b/snf-astakos-app/astakos/im/forms.py
436 436
    """
437 437
    email = forms.EmailField(label='E-mail address', help_text='E-mail address')
438 438
    renew = forms.BooleanField(label='Renew token', required=False)
439
    uuid = forms.CharField(label='User id', required=False)
440 439

  
441 440
    class Meta:
442 441
        model = AstakosUser
443
        fields = ('email', 'first_name', 'last_name', 'auth_token',
444
                  'auth_token_expires', 'uuid')
442
        fields = ('email', 'first_name', 'last_name')
445 443

  
446 444
    def __init__(self, *args, **kwargs):
447 445
        self.session_key = kwargs.pop('session_key', None)
448 446
        super(ProfileForm, self).__init__(*args, **kwargs)
449 447
        instance = getattr(self, 'instance', None)
450
        ro_fields = ('email', 'auth_token', 'auth_token_expires', 'uuid')
448
        ro_fields = ('email',)
451 449
        if instance and instance.id:
452 450
            for field in ro_fields:
453 451
                self.fields[field].widget.attrs['readonly'] = True
......
455 453
    def clean_email(self):
456 454
        return self.instance.email
457 455

  
458
    def clean_auth_token(self):
459
        return self.instance.auth_token
460

  
461
    def clean_auth_token_expires(self):
462
        return self.instance.auth_token_expires
463

  
464
    def clean_uuid(self):
465
        return self.instance.uuid
466

  
467 456
    def save(self, commit=True):
468 457
        user = super(ProfileForm, self).save(commit=False)
469 458
        user.is_verified = True
......
1024 1013
                'new_email_address',
1025 1014
                'first_name',
1026 1015
                'last_name',
1027
                'auth_token',
1028
                'auth_token_expires',
1029 1016
                'old_password',
1030 1017
                'new_password1',
1031 1018
                'new_password2',
1032 1019
                'change_email',
1033 1020
                'change_password',
1034
                'uuid'
1035 1021
        ]
1036 1022

  
1037 1023
        super(ExtendedProfileForm, self).__init__(*args, **kwargs)

Also available in: Unified diff