1
0
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:
jeremystretch
2022-04-18 08:36:41 -04:00
parent c21db0ff6a
commit 1636508a6a
2 changed files with 4 additions and 3 deletions

View File

@@ -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()