do not count unreachable code

This commit is contained in:
Matthias 2022-02-13 23:30:27 +01:00
parent c6464bcf77
commit ffafc20c6d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -267,7 +267,7 @@ class RuleSet(models.Model):
def __str__(self, debug=False):
""" Ruleset string representation """
if debug:
if debug: # pragma: no cover
# Makes debugging easier
return f'{str(self.group).ljust(15)}: {self.name.title().ljust(15)} | ' \
f'v: {str(self.can_view).ljust(5)} | a: {str(self.can_add).ljust(5)} | ' \
@ -450,7 +450,7 @@ def update_group_roles(group, debug=False):
if permission:
group.permissions.add(permission)
if debug:
if debug: # pragma: no cover
print(f"Adding permission {perm} to group {group.name}")
# Remove any extra permissions from the group
@ -465,7 +465,7 @@ def update_group_roles(group, debug=False):
if permission:
group.permissions.remove(permission)
if debug:
if debug: # pragma: no cover
print(f"Removing permission {perm} from group {group.name}")
# Enable all action permissions for certain children models