(self)
return self.cleaned_data['old_password']
Clean old password if needed
Clean old password if needed
Clean old password if needed
def clean_old_password(self):
        '''
        Clean old password if needed
        '''
        if 'old_password' not in self.data:
            return None

        if self.instance.password == '!':
            return None

        if not self.instance.check_password(self.cleaned_data['old_password']):
            raise django_forms.ValidationError(_(u'Invalid password.'))
        return self.cleaned_data['old_password']
def clean_old_password ( self ) : if 'old_password' not in self . data : return None if self . instance . password == '!' : return None if not self . instance . check_password ( self . cleaned_data [ 'old_password' ] ) : raise django_forms . ValidationError ( _ ( u'Invalid password.' ) ) return self . cleaned_data [ 'old_password' ]