mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 10:57:35 -02:30
correct filter events on the migration event horizon
events that existed *prior* to the partition migration will have `job_created=1970-01-01` auto-applied at migration time; as such, queries for these events e.g., /api/v2/job/N/job_events/ use 1970-01-01 in related event searche events created *after* the partition migration (net-new playbook runs will have `job_created` values that *exactly match* the related `UnifiedJob.created` field.
This commit is contained in:
@@ -41,8 +41,6 @@ from awx.api.views.mixin import RelatedJobsPreventDeleteMixin, ControlledByScmMi
|
||||
|
||||
logger = logging.getLogger('awx.api.views.organization')
|
||||
|
||||
EPOCH = datetime.datetime.utcfromtimestamp(0)
|
||||
|
||||
|
||||
class InventoryUpdateEventsList(SubListAPIView):
|
||||
|
||||
@@ -55,7 +53,7 @@ class InventoryUpdateEventsList(SubListAPIView):
|
||||
|
||||
def get_queryset(self):
|
||||
return super(InventoryUpdateEventsList, self).get_queryset().filter(
|
||||
job_created__in=(self.get_parent_object().created, EPOCH)
|
||||
job_created=self.get_parent_object().created_or_epoch
|
||||
)
|
||||
|
||||
def finalize_response(self, request, response, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user