Skip to content
Snippets Groups Projects
Verified Commit d16c0230 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

refactor: use better names for the messages

parent ae32c477
No related branches found
No related tags found
1 merge request!29Use docker main tag
Pipeline #7114 passed
......@@ -12,33 +12,33 @@ class Command(BaseCommand):
codename__startswith="edit"
)
self.stdout.write(
" Adding app permissions to the privileged group... ",
f" Adding app permissions to the '{program_group}' group... ",
ending="",
)
self.stdout.flush()
program_group.permissions.add(*app_permissions)
self.stdout.write(self.style.SUCCESS(len(app_permissions)))
broadcast_group = Group.objects.get(name=settings.ENTITLED_GROUPS[0])
host_group = Group.objects.get(name=settings.ENTITLED_GROUPS[0])
model_permissions = Permission.objects.filter(
content_type__model__in=["note", "notelink"]
).exclude(codename__startswith="edit")
self.stdout.write(
" Adding model permissions on note & notelink to the first entitled group... ",
f" Adding model permissions on note & notelink to the '{host_group}' group... ",
ending="",
)
self.stdout.flush()
broadcast_group.permissions.add(*model_permissions)
host_group.permissions.add(*model_permissions)
self.stdout.write(self.style.SUCCESS(len(model_permissions)))
broadcast_plus_group = Group.objects.get(name=settings.ENTITLED_GROUPS[1])
host_plus_group = Group.objects.get(name=settings.ENTITLED_GROUPS[1])
edit_permissions = Permission.objects.filter(
codename__startswith="edit", content_type__model__in=["host", "note", "show"]
)
self.stdout.write(
" Adding edit permissions on host, note & show to the second entitled group... ",
f" Adding edit permissions on host, note & show to the '{host_plus_group}' group... ",
ending="",
)
self.stdout.flush()
broadcast_plus_group.permissions.add(*edit_permissions)
host_plus_group.permissions.add(*edit_permissions)
self.stdout.write(self.style.SUCCESS(len(edit_permissions)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment