Browse Source

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

pull/828/merge
ibuler 7 years ago
parent
commit
22b7b84a45
  1. 6
      apps/assets/migrations/0001_initial.py
  2. 4
      apps/users/migrations/0001_initial.py

6
apps/assets/migrations/0001_initial.py

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

4
apps/users/migrations/0001_initial.py

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

Loading…
Cancel
Save