1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes : 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
docs/release-notes
netbox/users

@ -5,6 +5,7 @@
### Bug Fixes
* [#9133](https://github.com/netbox-community/netbox/issues/9133) - Upgrade script should require Python 3.8 or later
* [#9156](https://github.com/netbox-community/netbox/issues/9156) - Fix loading UserConfig data from fixtures
---

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