mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +00:00
Prevent auto-update of group permissions during loaddata stage
This commit is contained in:
parent
4f9898fba5
commit
2d7bff0773
@ -13,6 +13,7 @@ from django.dispatch import receiver
|
|||||||
from django.db.models.signals import post_save, post_delete
|
from django.db.models.signals import post_save, post_delete
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("inventree")
|
logger = logging.getLogger("inventree")
|
||||||
@ -270,6 +271,14 @@ def update_group_roles(group, debug=False):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if 'loaddata' in sys.argv:
|
||||||
|
"""
|
||||||
|
In the case that we are importing records,
|
||||||
|
*do not* update group roles:
|
||||||
|
This will cause conflicts in the database!
|
||||||
|
"""
|
||||||
|
return
|
||||||
|
|
||||||
# List of permissions already associated with this group
|
# List of permissions already associated with this group
|
||||||
group_permissions = set()
|
group_permissions = set()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user