From 57d64d31e28e1b8fc6023116df852d8811ce29cc Mon Sep 17 00:00:00 2001 From: git-hyagi <45576767+git-hyagi@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:46:15 -0300 Subject: [PATCH] Add a filter for `unblocked_at` for Tasks API closes: #6165 --- CHANGES/6165.feature | 1 + pulpcore/app/viewsets/base.py | 2 +- pulpcore/app/viewsets/task.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 CHANGES/6165.feature diff --git a/CHANGES/6165.feature b/CHANGES/6165.feature new file mode 100644 index 0000000000..c6ea3a2a40 --- /dev/null +++ b/CHANGES/6165.feature @@ -0,0 +1 @@ +Added the unblocked_at filter for Tasks API. diff --git a/pulpcore/app/viewsets/base.py b/pulpcore/app/viewsets/base.py index eaeb2fcc03..2bcb4d5ac9 100644 --- a/pulpcore/app/viewsets/base.py +++ b/pulpcore/app/viewsets/base.py @@ -45,7 +45,7 @@ # e.g. # /?name=foo # /?name__in=foo,bar -DATETIME_FILTER_OPTIONS = ["exact", "lt", "lte", "gt", "gte", "range"] +DATETIME_FILTER_OPTIONS = ["exact", "lt", "lte", "gt", "gte", "range", "isnull"] # e.g. # /?pulp_created__gte=2018-04-12T19:45:52 # /?pulp_created__range=2018-04-12T19:45:52,2018-04-13T19:45:52 diff --git a/pulpcore/app/viewsets/task.py b/pulpcore/app/viewsets/task.py index 36680d6f55..d013ef06e4 100644 --- a/pulpcore/app/viewsets/task.py +++ b/pulpcore/app/viewsets/task.py @@ -65,6 +65,7 @@ class Meta: "logging_cid": ["exact", "contains"], "started_at": DATETIME_FILTER_OPTIONS, "finished_at": DATETIME_FILTER_OPTIONS, + "unblocked_at": DATETIME_FILTER_OPTIONS, "parent_task": ["exact"], "child_tasks": ["exact"], "task_group": ["exact"],