* Fixes issue #26, thanks to Paul Boehm. User settings could be

duplicated in some circumstances.
This commit is contained in:
Ross Poulton 2008-11-18 00:03:12 +00:00
parent 988a4db198
commit 3361e08458

View File

@ -912,7 +912,7 @@ def create_usersettings(sender, created_models=[], instance=None, created=False,
""" """
if sender == User and created: if sender == User and created:
# This is a new user, so lets create their settings entry. # This is a new user, so lets create their settings entry.
s = UserSettings(user=instance) s, created = UserSettings.objects.get_or_create(user=instance)
s.save() s.save()
elif UserSettings in created_models: elif UserSettings in created_models:
# We just created the UserSettings model, lets create a UserSettings # We just created the UserSettings model, lets create a UserSettings