[Update] 修改创建默认集群,组等名称为Default

pull/828/merge
ibuler 7 years ago
parent 6a6d0cf279
commit 22b7b84a45

@ -12,18 +12,16 @@ def add_default_group(apps, schema_editor):
group_model = apps.get_model("assets", "AssetGroup") group_model = apps.get_model("assets", "AssetGroup")
db_alias = schema_editor.connection.alias db_alias = schema_editor.connection.alias
group_model.objects.using(db_alias).create( group_model.objects.using(db_alias).create(
name="default" name="Default"
) )
print("Add default group")
def add_default_cluster(apps, schema_editor): def add_default_cluster(apps, schema_editor):
cluster_model = apps.get_model("assets", "Cluster") cluster_model = apps.get_model("assets", "Cluster")
db_alias = schema_editor.connection.alias db_alias = schema_editor.connection.alias
cluster_model.objects.using(db_alias).create( cluster_model.objects.using(db_alias).create(
name="default" name="Default"
) )
print("Add default cluster")
class Migration(migrations.Migration): class Migration(migrations.Migration):

@ -16,9 +16,8 @@ def add_default_group(apps, schema_editor):
group_model = apps.get_model("users", "UserGroup") group_model = apps.get_model("users", "UserGroup")
db_alias = schema_editor.connection.alias db_alias = schema_editor.connection.alias
group_model.objects.using(db_alias).create( group_model.objects.using(db_alias).create(
name="default" name="Default"
) )
print("Add default user group: {}".format("default"))
def add_default_admin(apps, schema_editor): def add_default_admin(apps, schema_editor):
@ -29,7 +28,6 @@ def add_default_admin(apps, schema_editor):
email="admin@mycomany.com", role="Admin", email="admin@mycomany.com", role="Admin",
password=make_password("admin"), password=make_password("admin"),
) )
print("Add default user: {}".format(admin.name))
class Migration(migrations.Migration): class Migration(migrations.Migration):

Loading…
Cancel
Save