2024-03-17 10:26:32 +00:00
|
|
|
from django.apps import AppConfig
|
2024-04-14 11:23:35 +00:00
|
|
|
from .tools.signals import ensure_groups, ensure_languages
|
2024-04-12 20:23:49 +00:00
|
|
|
from django.db.models.signals import post_migrate
|
2024-03-17 10:26:32 +00:00
|
|
|
|
2024-04-13 00:12:21 +00:00
|
|
|
|
|
|
|
|
2024-03-17 10:26:32 +00:00
|
|
|
class FellchensammlungConfig(AppConfig):
|
|
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
|
|
name = 'fellchensammlung'
|
2024-04-12 20:23:49 +00:00
|
|
|
|
|
|
|
def ready(self):
|
2024-04-13 00:12:21 +00:00
|
|
|
from django.contrib.auth.models import Permission
|
|
|
|
try:
|
|
|
|
post_migrate.connect(ensure_groups, sender=self)
|
|
|
|
except Permission.DoesNotExist:
|
|
|
|
pass
|
2024-04-14 11:23:35 +00:00
|
|
|
post_migrate.connect(ensure_languages, sender=self)
|