#17 Update setup
* removes unused organisation app from project * removes null=True parameters for M2M fields in models
This commit is contained in:
@@ -11,8 +11,7 @@ from django.contrib.auth.models import User, Group
|
||||
from django.core.management import BaseCommand
|
||||
from django.db import transaction
|
||||
|
||||
from konova.management.commands.setup_data import TEST_ORGANISATION_DATA, GROUPS_DATA, USER_NOTIFICATIONS_NAMES
|
||||
from organisation.models import Organisation
|
||||
from konova.management.commands.setup_data import GROUPS_DATA, USER_NOTIFICATIONS_NAMES
|
||||
from user.enums import UserNotificationEnum
|
||||
from user.models import UserNotification
|
||||
|
||||
@@ -26,7 +25,6 @@ class Command(BaseCommand):
|
||||
try:
|
||||
with transaction.atomic():
|
||||
self._init_superuser()
|
||||
self._init_test_organisation()
|
||||
self._init_default_groups()
|
||||
self._init_user_notifications()
|
||||
except KeyboardInterrupt:
|
||||
@@ -62,20 +60,6 @@ class Command(BaseCommand):
|
||||
self._write_success("Superuser {} created".format(username))
|
||||
self._break_line()
|
||||
|
||||
def _init_test_organisation(self):
|
||||
""" Creates test organisations from predefined data
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
self._write_warning("--- Organisations ---")
|
||||
for org in TEST_ORGANISATION_DATA:
|
||||
db_org = Organisation.objects.get_or_create(
|
||||
**org
|
||||
)[0]
|
||||
self._write_success(CREATED_TEMPLATE.format(db_org.name))
|
||||
self._break_line()
|
||||
|
||||
def _init_default_groups(self):
|
||||
""" Creates the default groups for konova:
|
||||
* Group default
|
||||
@@ -112,6 +96,9 @@ class Command(BaseCommand):
|
||||
|
||||
self._break_line()
|
||||
|
||||
def _init_codelists(self):
|
||||
pass
|
||||
|
||||
def _break_line(self):
|
||||
""" Simply prints a line break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user