fix: Try to fix the group and permission creation

This commit is contained in:
2024-04-13 02:12:21 +02:00
parent 96b7f36749
commit a0f7d0188d
4 changed files with 38 additions and 6 deletions

View File

@@ -2,9 +2,15 @@ from django.apps import AppConfig
from .tools.signals import ensure_groups
from django.db.models.signals import post_migrate
class FellchensammlungConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'fellchensammlung'
def ready(self):
post_migrate.connect(ensure_groups, sender=self)
from django.contrib.auth.models import Permission
try:
post_migrate.connect(ensure_groups, sender=self)
except Permission.DoesNotExist:
pass