Commit c1b2c0e5 authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

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: default avatarJeremy Kerr <>
parent f0d09c7a
......@@ -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', '')
# saving the userprofile causes the firstname/lastname to propagate
# to the person objects.
return user
def clean(self):
......@@ -122,7 +122,7 @@ class UserProfile(models.Model):
for person in people:
person.user = self.user
def __str__(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment