~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to wlprofile/forms.py

  • Committer: Timo Wingender
  • Date: 2010-06-10 12:42:55 UTC
  • mto: This revision was merged to the branch mainline in revision 218.
  • Revision ID: timo.wingender@gmx.de-20100610124255-4958hbhzx9aqcrpa
Implement password change

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    def __init__(self, *args, **kwargs):
28
28
        instance = kwargs.pop("instance")
29
29
 
 
30
        print "instance: %s, kwargs: %s" % (instance, kwargs)
30
31
        super(EditProfileForm, self).__init__(instance=instance, *args,**kwargs)
31
32
 
32
33
        self.fields['email'].initial = instance.user.email
39
40
            raise forms.ValidationError('Length of signature is limited to %d' % settings.SIGNATURE_MAX_LENGTH)
40
41
        return value
41
42
 
42
 
    def save(self, *args, **kwargs):
43
 
        super(EditProfileForm, self).save(*args, **kwargs)
 
43
    def save(self):
 
44
        super(EditProfileForm, self).save()
44
45
 
45
46
        u = self.instance.user
46
47
        u.email = self.cleaned_data['email']
 
48
        print "u.email: %s" % (u.email)
47
49
 
48
 
        u.save(*args, **kwargs)
 
50
        u.save()
49
51
 
50
52
 
51
53