2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Unit testing fixes

This commit is contained in:
Oliver Walters
2020-10-06 16:03:19 +11:00
parent d691b15f4b
commit b3e4efd96e
3 changed files with 30 additions and 47 deletions

View File

@ -171,6 +171,10 @@ class RuleSet(models.Model):
super().save(*args, **kwargs)
if self.group:
# Update the group too!
self.group.save()
def get_models(self):
"""
Return the database tables / models that this ruleset covers.
@ -328,12 +332,7 @@ def create_missing_rule_sets(sender, instance, **kwargs):
group permissions.
"""
created = kwargs.get('created', False)
# To trigger the group permissions update: update_fields should not be None
update_fields = kwargs.get('update_fields', None)
if created or update_fields:
update_group_roles(instance)
update_group_roles(instance)
def check_user_role(user, role, permission):