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