agent-authentic2: update service's role's name (#34580)
This commit is contained in:
parent
11c79a9770
commit
b5bebd3e43
|
@ -11,7 +11,7 @@ from authentic2.a2_rbac.utils import get_default_ou
|
|||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.utils.translation import ugettext_lazy as _, activate
|
||||
from django.utils.translation import ugettext as _, activate
|
||||
from django.core import serializers
|
||||
|
||||
from django_rbac.utils import get_role_model, get_ou_model
|
||||
|
@ -179,7 +179,7 @@ class Command(hobo_deploy.Command):
|
|||
su_role, created = Role.objects.get_or_create(
|
||||
service=provider, slug='_a2-hobo-superuser',
|
||||
defaults={'name': name})
|
||||
if su_role.name == 'Superuser':
|
||||
if su_role.name != name:
|
||||
su_role.name = name
|
||||
su_role.save()
|
||||
su_role.attributes.get_or_create(name='is_superuser',
|
||||
|
|
Loading…
Reference in New Issue