mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
15 lines
485 B
Python
15 lines
485 B
Python
from django.apps import AppConfig
|
|
from django.db.models.signals import post_migrate
|
|
|
|
def create_speciality(sender, **kwargs):
|
|
from .models import Speciality
|
|
if not Speciality.objects.filter(name='GROUPE').exists():
|
|
Speciality.objects.create(name='GROUPE', colorCode='#FF0000')
|
|
|
|
class SchoolConfig(AppConfig):
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
name = 'School'
|
|
|
|
def ready(self):
|
|
post_migrate.connect(create_speciality, sender=self)
|