mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 18:21:03 -03:30
Only touch the attribute if it does not exist to avoid recursion in activity streams
This commit is contained in:
@@ -85,7 +85,8 @@ class ImplicitResourceField(models.ForeignKey):
|
|||||||
|
|
||||||
def _save(self, instance, *args, **kwargs):
|
def _save(self, instance, *args, **kwargs):
|
||||||
# Ensure that our field gets initialized after our first save
|
# Ensure that our field gets initialized after our first save
|
||||||
getattr(instance, self.name)
|
if not hasattr(instance, self.name):
|
||||||
|
getattr(instance, self.name)
|
||||||
|
|
||||||
|
|
||||||
class ImplicitRoleDescriptor(ReverseSingleRelatedObjectDescriptor):
|
class ImplicitRoleDescriptor(ReverseSingleRelatedObjectDescriptor):
|
||||||
@@ -257,4 +258,5 @@ class ImplicitRoleField(models.ForeignKey):
|
|||||||
|
|
||||||
def _save(self, instance, *args, **kwargs):
|
def _save(self, instance, *args, **kwargs):
|
||||||
# Ensure that our field gets initialized after our first save
|
# Ensure that our field gets initialized after our first save
|
||||||
getattr(instance, self.name)
|
if not hasattr(instance, self.name):
|
||||||
|
getattr(instance, self.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user