misc: adapt import for new rbac module location (#70545)

This commit is contained in:
Frédéric Péters 2022-10-20 22:27:05 +02:00
parent a80d9b5de3
commit e1c8e88a4a
1 changed files with 13 additions and 5 deletions

View File

@ -24,11 +24,19 @@ from django.db.models.signals import post_save, post_migrate
from django.contrib.contenttypes.models import ContentType
from django_rbac.utils import get_operation
from django_rbac.models import (
ADMIN_OP,
CHANGE_OP,
ADD_OP,
)
try:
from authentic2.a2_rbac.models import (
ADMIN_OP,
CHANGE_OP,
ADD_OP,
)
except ImportError: # legacy
from django_rbac.models import (
ADMIN_OP,
CHANGE_OP,
ADD_OP,
)
from authentic2.custom_user.models import User
from authentic2.a2_rbac.models import (