mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 19:26:48 +00:00
It created the group with objects.create and had no reverse: it failed when the group existed and could not be unapplied. It now uses get_or_create, and its reverse does nothing.
17 lines
388 B
Python
17 lines
388 B
Python
from django.db import migrations
|
|
|
|
|
|
def apply_migration(apps, schema_editor):
|
|
Group = apps.get_model("auth", "Group")
|
|
Group.objects.get_or_create(name="Technicians")
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("admin", "0002_auto_20200609_0830"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(apply_migration, migrations.RunPython.noop),
|
|
]
|