Don't make the default organization name hardcoded.
This commit is contained in:
@@ -5,3 +5,4 @@ DEFAULT_ORGANIZATION_ADMIN_EMAIL = 'oadmin@example.com'
|
||||
DEFAULT_ORGANIZATION_ADMIN_PASSWORD = None
|
||||
DEFAULT_ORGANIZATION_ADMIN_ROLE = 'Organization admins'
|
||||
DEFAULT_ORGANIZATION_ADMIN_USERNAME = 'oadmin'
|
||||
DEFAULT_ORGANIZATION_LABEL = 'Default'
|
||||
|
||||
@@ -3,12 +3,14 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
from ..literals import DEFAULT_ORGANIZATION_LABEL
|
||||
|
||||
|
||||
def default_data(apps, schema_editor):
|
||||
# We can't import the Organization model directly as it may be a newer
|
||||
# version than this migration expects. We use the historical version.
|
||||
Organization = apps.get_model("organizations", "Organization")
|
||||
default_organization = Organization(label='Default')
|
||||
default_organization = Organization(label=DEFAULT_ORGANIZATION_LABEL)
|
||||
default_organization.save()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user