summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/forms.py
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-09-09 14:27:27 +1000
committerJeremy Kerr <jk@ozlabs.org>2008-09-09 14:27:27 +1000
commitc1b2c0e5787a1ba487cda222596b0ca7ae94f288 (patch)
treeefea4e6ff903a98eaa4bb08c71550c8f9b4b2c47 /apps/patchwork/forms.py
parentf0d09c7ad846a02c4d5d99bfe412b0ba35164150 (diff)
downloadpatchwork-c1b2c0e5787a1ba487cda222596b0ca7ae94f288.tar.bz2
patchwork-c1b2c0e5787a1ba487cda222596b0ca7ae94f288.tar.xz
Re-save user profile after setting name
This means we get Person objects created with the correct name, rather than the username at time of creation. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/forms.py')
-rw-r--r--apps/patchwork/forms.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/patchwork/forms.py b/apps/patchwork/forms.py
index c02d11e..bc746bd 100644
--- a/apps/patchwork/forms.py
+++ b/apps/patchwork/forms.py
@@ -44,6 +44,11 @@ class RegistrationForm(RegistrationFormUniqueEmail):
user.first_name = self.cleaned_data.get('first_name', '')
user.last_name = self.cleaned_data.get('last_name', '')
user.save()
+
+ # saving the userprofile causes the firstname/lastname to propagate
+ # to the person objects.
+ user.get_profile().save()
+
return user
def clean(self):