Projet

Général

Profil

« Précédent | Suivant » 

Révision 7b499930

Ajouté par Serghei Mihai (congés, retour 15/05) il y a environ 9 ans

user credentials and edit views(#7065)

Voir les différences:

uauth/organization/forms.py
14 14
            'password': forms.PasswordInput
15 15
        }
16 16

  
17
    def save(self):
18
        # save previous password
19
        old_password = self.initial.get('password')
20
        obj = super(LocalAccountForm, self).save(commit=False)
21
        if not self.cleaned_data.get('password'):
22
            obj.password = old_password
23
        obj.save()
24
        return obj
25

  
17 26

  
18 27
class LocalAccountCreateForm(LocalAccountForm):
19 28
    accounts_number = forms.IntegerField(_('Number of accounts to create'), required=False)

Formats disponibles : Unified diff