check if is active module hid
This commit is contained in:
parent
84e937026e
commit
31b62a2d81
|
@ -9,7 +9,8 @@ from typing import Dict, List, Set
|
||||||
|
|
||||||
from boltons import urlutils
|
from boltons import urlutils
|
||||||
from citext import CIText
|
from citext import CIText
|
||||||
from ereuse_utils.naming import HID_CONVERSION_DOC, Naming
|
from ereuse_utils.naming import HID_CONVERSION_DOC
|
||||||
|
from flask import current_app as app
|
||||||
from flask import g, request
|
from flask import g, request
|
||||||
from more_itertools import unique_everseen
|
from more_itertools import unique_everseen
|
||||||
from sqlalchemy import BigInteger, Boolean, Column
|
from sqlalchemy import BigInteger, Boolean, Column
|
||||||
|
@ -770,14 +771,15 @@ class Device(Thing):
|
||||||
).first()
|
).first()
|
||||||
|
|
||||||
def set_hid(self):
|
def set_hid(self):
|
||||||
try:
|
if 'property_hid' not in app.blueprints.keys():
|
||||||
from modules.device.utils import set_hid
|
try:
|
||||||
|
from modules.device.utils import set_hid
|
||||||
|
|
||||||
self.hid = set_hid(self)
|
self.hid = set_hid(self)
|
||||||
self.set_chid()
|
self.set_chid()
|
||||||
return
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.hid = "{}-{}-{}-{}".format(
|
self.hid = "{}-{}-{}-{}".format(
|
||||||
self._clean_string(self.type),
|
self._clean_string(self.type),
|
||||||
|
|
Reference in New Issue