mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
Fix an issue with hasattr call
This commit is contained in:
parent
c07a4ff93d
commit
ebbd42322d
@ -389,7 +389,7 @@ def activity_stream_create(sender, instance, created, **kwargs):
|
||||
if isinstance(instance, InventorySource) and instance.deprecated_group:
|
||||
return
|
||||
_type = type(instance)
|
||||
if hasattr(_type, '_deferred', False):
|
||||
if hasattr(_type, '_deferred'):
|
||||
return
|
||||
object1 = camelcase_to_underscore(instance.__class__.__name__)
|
||||
changes = model_to_dict(instance, model_serializer_mapping)
|
||||
@ -425,7 +425,7 @@ def activity_stream_update(sender, instance, **kwargs):
|
||||
if changes is None:
|
||||
return
|
||||
_type = type(instance)
|
||||
if hasattr(_type, '_deferred', False):
|
||||
if hasattr(_type, '_deferred'):
|
||||
return
|
||||
object1 = camelcase_to_underscore(instance.__class__.__name__)
|
||||
activity_entry = ActivityStream(
|
||||
@ -452,7 +452,7 @@ def activity_stream_delete(sender, instance, **kwargs):
|
||||
if isinstance(instance, Inventory) and not kwargs.get('inventory_delete_flag', False):
|
||||
return
|
||||
_type = type(instance)
|
||||
if hasattr(_type, '_deferred', False):
|
||||
if hasattr(_type, '_deferred'):
|
||||
return
|
||||
changes = model_to_dict(instance)
|
||||
object1 = camelcase_to_underscore(instance.__class__.__name__)
|
||||
@ -476,7 +476,7 @@ def activity_stream_associate(sender, instance, **kwargs):
|
||||
return
|
||||
obj1 = instance
|
||||
_type = type(instance)
|
||||
if hasattr(_type, '_deferred', False):
|
||||
if hasattr(_type, '_deferred'):
|
||||
return
|
||||
object1=camelcase_to_underscore(obj1.__class__.__name__)
|
||||
obj_rel = sender.__module__ + "." + sender.__name__
|
||||
@ -489,7 +489,7 @@ def activity_stream_associate(sender, instance, **kwargs):
|
||||
continue
|
||||
obj2_actual = obj2_actual[0]
|
||||
_type = type(obj2_actual)
|
||||
if hasattr(_type, '_deferred', False):
|
||||
if hasattr(_type, '_deferred'):
|
||||
return
|
||||
if isinstance(obj2_actual, Role) and obj2_actual.content_object is not None:
|
||||
obj2_actual = obj2_actual.content_object
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user