forked from extern/django-helpdesk
* Fixes issue #26, thanks to Paul Boehm. User settings could be
duplicated in some circumstances.
This commit is contained in:
parent
988a4db198
commit
3361e08458
@ -912,7 +912,7 @@ def create_usersettings(sender, created_models=[], instance=None, created=False,
|
||||
"""
|
||||
if sender == User and created:
|
||||
# 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()
|
||||
elif UserSettings in created_models:
|
||||
# We just created the UserSettings model, lets create a UserSettings
|
||||
|
Loading…
Reference in New Issue
Block a user