diff --git a/apps/ops/api/adhoc.py b/apps/ops/api/adhoc.py index 0cc7b6d55..ac6983669 100644 --- a/apps/ops/api/adhoc.py +++ b/apps/ops/api/adhoc.py @@ -24,7 +24,7 @@ __all__ = [ class TaskViewSet(OrgBulkModelViewSet): model = Task - filterset_fields = ("name",) + filterset_fields = ("name", "adhoc__execution__celery_task_id") search_fields = filterset_fields serializer_class = TaskSerializer @@ -54,6 +54,7 @@ class TaskRun(generics.RetrieveAPIView): class AdHocViewSet(viewsets.ModelViewSet): queryset = AdHoc.objects.all() + filterset_fields = ('execution__celery_task_id', ) serializer_class = AdHocSerializer def get_serializer_class(self): diff --git a/apps/ops/serializers/adhoc.py b/apps/ops/serializers/adhoc.py index 094abf958..eefc185c6 100644 --- a/apps/ops/serializers/adhoc.py +++ b/apps/ops/serializers/adhoc.py @@ -17,7 +17,7 @@ class AdHocExecutionSerializer(serializers.ModelSerializer): fields_mini = ['id'] fields_small = fields_mini + [ 'hosts_amount', 'timedelta', 'result', 'summary', 'short_id', - 'is_finished', 'is_success', + 'is_finished', 'is_success', 'celery_task_id', 'date_start', 'date_finished', ] fields_fk = ['task', 'task_display', 'adhoc', 'adhoc_short_id',]