From 2bb6b13e0765aac0a5d238f65203e416288ee648 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 20 Dec 2022 11:06:41 +0100 Subject: [PATCH] fix --- ereuse_devicehub/resources/device/models.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 222f0d54..39677597 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -753,12 +753,13 @@ class Device(Thing): return "" def get_from_db(self): - try: - from modules.device.utils import get_from_db + if 'property_hid' in app.blueprints.keys(): + try: + from modules.device.utils import get_from_db - return get_from_db(self) - except Exception: - pass + return get_from_db(self) + except Exception: + pass if not self.hid: return @@ -771,7 +772,7 @@ class Device(Thing): ).first() def set_hid(self): - if 'property_hid' not in app.blueprints.keys(): + if 'property_hid' in app.blueprints.keys(): try: from modules.device.utils import set_hid