mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03:30
Only touch the attribute if it does not exist to avoid recursion in activity streams
This commit is contained in:
parent
241ee09fff
commit
74e1554463
@ -85,7 +85,8 @@ class ImplicitResourceField(models.ForeignKey):
|
||||
|
||||
def _save(self, instance, *args, **kwargs):
|
||||
# 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):
|
||||
@ -257,4 +258,5 @@ class ImplicitRoleField(models.ForeignKey):
|
||||
|
||||
def _save(self, instance, *args, **kwargs):
|
||||
# Ensure that our field gets initialized after our first save
|
||||
getattr(instance, self.name)
|
||||
if not hasattr(instance, self.name):
|
||||
getattr(instance, self.name)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user