Commit 9423f034 authored by Thibaut Broggi's avatar Thibaut Broggi

Set role "padawan" to all users

parent f916864f
Pipeline #1429 passed with stages
in 1 minute and 52 seconds
from django.db import migrations
from django.contrib.auth.models import Group, User
def add_groups(apps, schema_editor):
users = User.objects.all()
padawanGroup = Group.objects.get(name='Padawan')
for user in users:
user.groups.add(padawanGroup)
user.save()
class Migration(migrations.Migration):
dependencies = [
('rp', '0017_groups'),
]
operations = [
migrations.RunPython(add_groups),
]
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