Commit 61688335 authored by Michal Čihař's avatar Michal Čihař

Adjust privileges every time this is run

parent dbbb107d
...@@ -15,15 +15,14 @@ class Command(BaseCommand): ...@@ -15,15 +15,14 @@ class Command(BaseCommand):
def handle(self, *args, **options): def handle(self, *args, **options):
group, created = Group.objects.get_or_create(name = 'Users') group, created = Group.objects.get_or_create(name = 'Users')
if created: group.permissions.add(
group.permissions.add( Permission.objects.get(codename = 'upload_translation'),
Permission.objects.get(codename = 'upload_translation'), Permission.objects.get(codename = 'overwrite_translation'),
Permission.objects.get(codename = 'overwrite_translation'), Permission.objects.get(codename = 'save_translation'),
Permission.objects.get(codename = 'save_translation'), Permission.objects.get(codename = 'accept_suggestion'),
Permission.objects.get(codename = 'accept_suggestion'), Permission.objects.get(codename = 'delete_suggestion'),
Permission.objects.get(codename = 'delete_suggestion'), Permission.objects.get(codename = 'ignore_check'),
Permission.objects.get(codename = 'ignore_check'), )
)
if options['move']: if options['move']:
for u in User.objects.all(): for u in User.objects.all():
u.groups.add(group) u.groups.add(group)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment