From 27239a87c142370e003a376f4f0682f9f10ea169 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 26 Aug 2020 20:37:08 +0000 Subject: [PATCH] fix more than 1 task assigned to a check for agents on 0.10.2 or lower --- api/tacticalrmm/checks/serializers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/tacticalrmm/checks/serializers.py b/api/tacticalrmm/checks/serializers.py index 16b730fc..57c22318 100644 --- a/api/tacticalrmm/checks/serializers.py +++ b/api/tacticalrmm/checks/serializers.py @@ -83,7 +83,9 @@ class CheckRunnerGetSerializer(serializers.ModelSerializer): def get_assigned_task(self, obj): if obj.assignedtask.exists(): - task = obj.assignedtask.get() + # this will not break agents on version 0.10.2 or lower + # newer agents once released will properly handle multiple tasks assigned to a check + task = obj.assignedtask.first() return AssignedTaskCheckRunnerField(task).data class Meta: