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:
@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user