]> git.ozlabs.org Git - patchwork/commit
models: Update Person & UserProfile object whenever User is saved
authorJeremy Kerr <jk@ozlabs.org>
Mon, 19 Sep 2011 02:33:51 +0000 (10:33 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 19 Sep 2011 02:33:51 +0000 (10:33 +0800)
commit4bc2c34df5e5eb3e7153286f59aa8bdaf0c23dc0
tree971498466574214e4a3a90a451278e4386e51768
parent75d8cf966034e673afe0077ba393d8b2eb3e9b93
models: Update Person & UserProfile object whenever User is saved

Currently, UserProfiles are only saved on creation of the User object,
before the first_name and last_name attributes are set. This means that
we fallback to using the User.username value as the new Person.name.

This change modifies User's post-save signal to always update the Person
object, both on creation and updates. This means we get the proper name
appearing on Person instances.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/models.py
apps/patchwork/tests/registration.py