Verified Commit 1486ce3e authored by Thibaut Broggi's avatar Thibaut Broggi
Browse files

Add groups (Jedi, Padawan, Droid) in database

parent 420236b7
Pipeline #1236 passed with stages
in 2 minutes
from django.db import migrations
from django.contrib.auth.models import Group
def add_groups(apps, schema_editor):
groups = ['Jedi', 'Padawan', 'Droid']
for i in groups:
group = Group(name=i)
def remove_groups(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [
('rp', '0016_auto_20170617_0929'),
operations = [
migrations.RunPython(add_groups, reverse_code=remove_groups),
Supports Markdown
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