mirror of
https://github.com/veops/cmdb.git
synced 2025-08-09 23:49:11 +08:00
fix(api): get citype
This commit is contained in:
@@ -64,9 +64,13 @@ class CITypeView(APIView):
|
|||||||
ci_type['unique_name'] = ci_type['unique_id'] and AttributeCache.get(ci_type['unique_id']).name
|
ci_type['unique_name'] = ci_type['unique_id'] and AttributeCache.get(ci_type['unique_id']).name
|
||||||
ci_types.append(ci_type)
|
ci_types.append(ci_type)
|
||||||
elif type_name is not None:
|
elif type_name is not None:
|
||||||
ci_type = CITypeCache.get(type_name).to_dict()
|
ci_type = CITypeCache.get(type_name)
|
||||||
ci_type['parent_ids'] = CITypeInheritanceManager.get_parents(ci_type['id'])
|
if ci_type is not None:
|
||||||
ci_types = [ci_type]
|
ci_type = ci_type.to_dict()
|
||||||
|
ci_type['parent_ids'] = CITypeInheritanceManager.get_parents(ci_type['id'])
|
||||||
|
ci_types = [ci_type]
|
||||||
|
else:
|
||||||
|
ci_types = []
|
||||||
else:
|
else:
|
||||||
ci_types = CITypeManager().get_ci_types(q)
|
ci_types = CITypeManager().get_ci_types(q)
|
||||||
count = len(ci_types)
|
count = len(ci_types)
|
||||||
|
Reference in New Issue
Block a user