Tiny code refactoring

This commit is contained in:
Christian Mäder 2020-02-02 09:48:02 +01:00
parent 69ef7b7827
commit 3d80cc5a72
2 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ with file.open('r') as stream:
Token.objects.create(user=user, key=user_details['api_token'])
yaml_permissions = user_details.get('permissions', [])
subject = user.user_permissions
if yaml_permissions:
subject = user.user_permissions
subject.clear()
for yaml_permission in yaml_permissions:
if '*' in yaml_permission:

View File

@ -25,8 +25,8 @@ with file.open('r') as stream:
user.groups.add(group)
yaml_permissions = group_details.get('permissions', [])
subject = group.permissions
if yaml_permissions:
subject = group.permissions
subject.clear()
for yaml_permission in yaml_permissions:
if '*' in yaml_permission: