mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
avoid DB action in signal, confusing logs
This commit is contained in:
parent
a9c9646060
commit
6d7f772e98
@ -205,7 +205,7 @@ def set_original_organization(sender, instance, **kwargs):
|
||||
pre-save organization, so we can later determine if the organization
|
||||
field is dirty.
|
||||
'''
|
||||
instance.__original_org = instance.organization
|
||||
instance.__original_org_id = instance.organization_id
|
||||
|
||||
|
||||
def save_related_job_templates(sender, instance, **kwargs):
|
||||
@ -217,7 +217,7 @@ def save_related_job_templates(sender, instance, **kwargs):
|
||||
if sender not in (Project, Inventory):
|
||||
raise ValueError('This signal callback is only intended for use with Project or Inventory')
|
||||
|
||||
if instance.__original_org != instance.organization:
|
||||
if instance.__original_org_id != instance.organization_id:
|
||||
jtq = JobTemplate.objects.filter(**{sender.__name__.lower(): instance})
|
||||
for jt in jtq:
|
||||
update_role_parentage_for_instance(jt)
|
||||
|
Loading…
Reference in New Issue
Block a user