mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 23:37:39 -02:30
Adjust inventory computed field calculations to happen in the celery context
This commit is contained in:
@@ -13,6 +13,7 @@ from django.utils.timezone import now, make_aware, get_default_timezone
|
||||
|
||||
# AWX
|
||||
from awx.main.models.base import *
|
||||
from awx.main.utils import ignore_inventory_computed_fields
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
logger = logging.getLogger('awx.main.models.schedule')
|
||||
@@ -104,7 +105,6 @@ class Schedule(CommonModel):
|
||||
self.dtend = make_aware(datetime.datetime.strptime(until_date, "%Y%m%dT%H%M%SZ"), get_default_timezone())
|
||||
if 'count' in self.rrule.lower():
|
||||
self.dtend = future_rs[-1]
|
||||
from awx.main.signals import ignore_inventory_computed_fields
|
||||
with ignore_inventory_computed_fields():
|
||||
self.unified_job_template.update_computed_fields()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user