From 69c3a7cda7f8a19394fc8f34d890010b560a615c Mon Sep 17 00:00:00 2001 From: fan9704 Date: Thu, 19 Oct 2023 12:47:50 +0800 Subject: [PATCH] fix: Listener Exception Error --- api/management/commands/callback/recordCallBack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/management/commands/callback/recordCallBack.py b/api/management/commands/callback/recordCallBack.py index 45efb06..69243a0 100644 --- a/api/management/commands/callback/recordCallBack.py +++ b/api/management/commands/callback/recordCallBack.py @@ -28,7 +28,7 @@ def temperature_humidity_callback(topic: str, body: str, ch=None, method=None, p ''' notify("溫度異常", notify_content, 1) # Todo: 溫度異常 - machine = models.Machine.objects.get_or_create(name=topic.split("/")[1]) + machine, created = models.Machine.objects.get_or_create(name=topic.split("/")[1]) temperature_record_type = models.RecordType.objects.get(type="temperature") humidity_record_type = models.RecordType.objects.get(type="humidity")