Prevent auto-update of group permissions during loaddata stage

This commit is contained in:
Oliver Walters 2021-04-25 10:30:56 +10:00
parent 4f9898fba5
commit 2d7bff0773

View File

@ -13,6 +13,7 @@ from django.dispatch import receiver
from django.db.models.signals import post_save, post_delete
import logging
import sys
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
group_permissions = set()