mirror of
https://github.com/ansible/awx.git
synced 2026-02-20 12:40:06 -03:30
@@ -20,7 +20,7 @@ from django.utils.encoding import smart_text
|
|||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.models.rbac import Role, batch_role_ancestor_rebuilding
|
from awx.main.models.rbac import batch_role_ancestor_rebuilding
|
||||||
from awx.main.utils import get_current_apps
|
from awx.main.utils import get_current_apps
|
||||||
|
|
||||||
__all__ = ['AutoOneToOneField', 'ImplicitRoleField']
|
__all__ = ['AutoOneToOneField', 'ImplicitRoleField']
|
||||||
@@ -274,13 +274,11 @@ class ImplicitRoleField(models.ForeignKey):
|
|||||||
if qs.count() >= 1:
|
if qs.count() >= 1:
|
||||||
role = qs[0]
|
role = qs[0]
|
||||||
else:
|
else:
|
||||||
role = Role_.objects.create(
|
role = Role_.objects.create(created=now(),
|
||||||
created=now(),
|
modified=now(),
|
||||||
modified=now(),
|
singleton_name=singleton_name,
|
||||||
singleton_name=singleton_name,
|
name=singleton_name,
|
||||||
name=singleton_name,
|
description=singleton_name)
|
||||||
description=singleton_name
|
|
||||||
)
|
|
||||||
parents = [role]
|
parents = [role]
|
||||||
else:
|
else:
|
||||||
parents = resolve_role_field(instance, path)
|
parents = resolve_role_field(instance, path)
|
||||||
|
|||||||
Reference in New Issue
Block a user