mirror of
				https://github.com/veops/cmdb.git
				synced 2025-11-01 03:49:31 +08:00 
			
		
		
		
	fix dashboard compute
This commit is contained in:
		| @@ -342,7 +342,7 @@ class CMDBCounterCache(object): | |||||||
|         type_ids = custom['options'].get('type_ids') or (type_id and [type_id]) |         type_ids = custom['options'].get('type_ids') or (type_id and [type_id]) | ||||||
|         attr_ids = list(map(str, custom['options'].get('attr_ids') or (attr_id and [attr_id]))) |         attr_ids = list(map(str, custom['options'].get('attr_ids') or (attr_id and [attr_id]))) | ||||||
|         other_filter = custom['options'].get('filter') |         other_filter = custom['options'].get('filter') | ||||||
|         other_filter = "({})".format(other_filter) if other_filter else '' |         other_filter = "{}".format(other_filter) if other_filter else '' | ||||||
|  |  | ||||||
|         if custom['options'].get('ret') == 'cis': |         if custom['options'].get('ret') == 'cis': | ||||||
|             query = "_type:({}),{}".format(";".join(map(str, type_ids)), other_filter) |             query = "_type:({}),{}".format(";".join(map(str, type_ids)), other_filter) | ||||||
|   | |||||||
| @@ -582,7 +582,8 @@ class CITypeRelationManager(object): | |||||||
|  |  | ||||||
|         def get_children(_id, level): |         def get_children(_id, level): | ||||||
|             children = CITypeRelation.get_by(parent_id=_id, to_dict=False) |             children = CITypeRelation.get_by(parent_id=_id, to_dict=False) | ||||||
|             result[level + 1] = [i.child.to_dict() for i in children] |             if children: | ||||||
|  |                 result.setdefault(level + 1, []).extend([i.child.to_dict() for i in children]) | ||||||
|  |  | ||||||
|             for i in children: |             for i in children: | ||||||
|                 if i.child_id != _id: |                 if i.child_id != _id: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user