mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
only special case team when sender is Role_parents
This commit is contained in:
@@ -158,14 +158,13 @@ def org_admin_edit_members(instance, action, model, reverse, pk_set, **kwargs):
|
|||||||
|
|
||||||
def rbac_activity_stream(instance, sender, **kwargs):
|
def rbac_activity_stream(instance, sender, **kwargs):
|
||||||
user_type = ContentType.objects.get_for_model(User)
|
user_type = ContentType.objects.get_for_model(User)
|
||||||
team_type = ContentType.objects.get_for_model(Team)
|
|
||||||
# Only if we are associating/disassociating
|
# Only if we are associating/disassociating
|
||||||
if kwargs['action'] in ['pre_add', 'pre_remove']:
|
if kwargs['action'] in ['pre_add', 'pre_remove']:
|
||||||
# Only if this isn't for the User.admin_role
|
# Only if this isn't for the User.admin_role
|
||||||
if hasattr(instance, 'content_type'):
|
if hasattr(instance, 'content_type'):
|
||||||
if instance.content_type in [None, user_type]:
|
if instance.content_type in [None, user_type]:
|
||||||
return
|
return
|
||||||
elif instance.content_type == team_type:
|
elif sender.__name__ == 'Role_parents':
|
||||||
role = kwargs['model'].objects.filter(pk__in=kwargs['pk_set']).first()
|
role = kwargs['model'].objects.filter(pk__in=kwargs['pk_set']).first()
|
||||||
else:
|
else:
|
||||||
role = instance
|
role = instance
|
||||||
|
|||||||
Reference in New Issue
Block a user