mirror of https://github.com/veops/cmdb.git
fix(api): in query
This commit is contained in:
parent
a2224ba2ac
commit
6e02f6a21f
|
@ -56,7 +56,7 @@ QUERY_CI_BY_ATTR_NAME = """
|
|||
SELECT {0}.ci_id
|
||||
FROM {0}
|
||||
WHERE {0}.attr_id={1:d}
|
||||
AND {0}.value {2}
|
||||
AND ({0}.value {2})
|
||||
"""
|
||||
|
||||
QUERY_CI_BY_ID = """
|
||||
|
|
|
@ -77,7 +77,7 @@ class AttributeValueManager(object):
|
|||
else:
|
||||
res[field_name] = ValueTypeMap.serialize[attr.value_type](rs[0].value) if rs else None
|
||||
|
||||
if field_name in enum_map:
|
||||
if enum_map and field_name in enum_map:
|
||||
if attr.is_list:
|
||||
res[field_name] = [enum_map[field_name].get(i, i) for i in res[field_name]]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue