mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Revert "Fix up hook conditions for rbac activity stream"
This reverts commit 36c14f83bcb11fcdbd31140ce182ab87e3db4644.
This commit is contained in:
@@ -159,7 +159,7 @@ 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)
|
||||||
# Only if we are associating/disassociating
|
# Only if we are associating/disassociating
|
||||||
if kwargs['action'] in ['post_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]:
|
||||||
@@ -396,7 +396,7 @@ def activity_stream_delete(sender, instance, **kwargs):
|
|||||||
def activity_stream_associate(sender, instance, **kwargs):
|
def activity_stream_associate(sender, instance, **kwargs):
|
||||||
if not activity_stream_enabled:
|
if not activity_stream_enabled:
|
||||||
return
|
return
|
||||||
if kwargs['action'] in ['post_add', 'pre_remove']:
|
if kwargs['action'] in ['pre_add', 'pre_remove']:
|
||||||
if kwargs['action'] == 'pre_add':
|
if kwargs['action'] == 'pre_add':
|
||||||
action = 'associate'
|
action = 'associate'
|
||||||
elif kwargs['action'] == 'pre_remove':
|
elif kwargs['action'] == 'pre_remove':
|
||||||
|
|||||||
Reference in New Issue
Block a user