From c68da5898ad7650651d6e57f493f8c7c01922647 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 26 Feb 2018 12:31:33 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/migrations/0001_initial.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/users/migrations/0001_initial.py b/apps/users/migrations/0001_initial.py index 521f2efe2..01edf24b6 100644 --- a/apps/users/migrations/0001_initial.py +++ b/apps/users/migrations/0001_initial.py @@ -28,6 +28,9 @@ def add_default_admin(apps, schema_editor): email="admin@mycomany.com", role="Admin", password=make_password("admin"), ) + group_model = apps.get_model("users", "UserGroup") + default_group = group_model.objects.using(db_alias).get(name="Default") + admin.groups.add(default_group) class Migration(migrations.Migration):