Commit 07562156 authored by okhin's avatar okhin 🚴

Adding a create_user permission and updating the jedi group with superuser

parent 91a68fd6
......@@ -6,7 +6,7 @@ permissions = {
"droid": [],
"jedi": [
"can_change_status", "can_change_priority", "can_vote", "can_edit",
"can_edit_users", "can_delete_users", "can_create_user",
"can_edit_users", "can_delete_users", "can_create_users",
],
"padawan": ["can_vote", "add_article"]
}
......@@ -28,7 +28,7 @@ class Command(BaseCommand):
users = User.objects.all()
for user in users:
if user.is_superuser():
user.group.adds(Group.objects.get(name='jedi'))
if user.is_superuser:
user.groups.add(Group.objects.get(name='jedi'))
else:
user.groups.add(Group.objects.get(name="padawan"))
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2019-03-13 16:28
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0003_auto_20180109_1642'),
]
operations = [
migrations.AlterModelOptions(
name='profile',
options={'permissions': (('can_edit_users', 'Can edit users'), ('can_delete_users', 'Can delete users'), ('can_create_users', 'Can create users')), 'verbose_name': 'User'},
),
]
......@@ -42,6 +42,7 @@ class Profile(models.Model):
permissions = (
("can_edit_users", "Can edit users",),
("can_delete_users", "Can delete users",),
("can_create_users", "Can create users",),
)
def __str__(self):
......
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