mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #9156: Fix loading UserConfig data from fixtures
This commit is contained in:
@@ -173,11 +173,11 @@ class UserConfig(models.Model):
|
||||
|
||||
|
||||
@receiver(post_save, sender=User)
|
||||
def create_userconfig(instance, created, **kwargs):
|
||||
def create_userconfig(instance, created, raw=False, **kwargs):
|
||||
"""
|
||||
Automatically create a new UserConfig when a new User is created.
|
||||
Automatically create a new UserConfig when a new User is created. Skip this if importing a user from a fixture.
|
||||
"""
|
||||
if created:
|
||||
if created and not raw:
|
||||
config = get_config()
|
||||
UserConfig(user=instance, data=config.DEFAULT_USER_PREFERENCES).save()
|
||||
|
||||
|
Reference in New Issue
Block a user