mirror of https://github.com/veops/cmdb.git
Fix bug 1217 (#656)
* fix(api): move soft delete of PreferenceShowAttributes to correct location * chore: add manage.sh to .gitignore * fix(api): correct type_id reference in CITypeAttributeManager for PreferenceShowAttributes soft delete * Update .gitignore --------- Co-authored-by: pycook <pycook@126.com>
This commit is contained in:
parent
ada23262bb
commit
747475b6a6
|
@ -78,7 +78,3 @@ cmdb-ui/npm-debug.log*
|
||||||
cmdb-ui/yarn-debug.log*
|
cmdb-ui/yarn-debug.log*
|
||||||
cmdb-ui/yarn-error.log*
|
cmdb-ui/yarn-error.log*
|
||||||
cmdb-ui/package-lock.json
|
cmdb-ui/package-lock.json
|
||||||
start.sh
|
|
||||||
manage.sh
|
|
||||||
.env
|
|
||||||
cmdb-api/.env
|
|
||||||
|
|
|
@ -722,9 +722,6 @@ class CITypeAttributeManager(object):
|
||||||
|
|
||||||
ci_cache.apply_async(args=(ci.id, None, None), queue=CMDB_QUEUE)
|
ci_cache.apply_async(args=(ci.id, None, None), queue=CMDB_QUEUE)
|
||||||
|
|
||||||
for item in PreferenceShowAttributes.get_by(type_id=type_id, attr_id=attr_id, to_dict=False):
|
|
||||||
item.soft_delete(commit=False)
|
|
||||||
|
|
||||||
child_ids = CITypeInheritanceManager.recursive_children(type_id)
|
child_ids = CITypeInheritanceManager.recursive_children(type_id)
|
||||||
for _type_id in [type_id] + child_ids:
|
for _type_id in [type_id] + child_ids:
|
||||||
for item in CITypeUniqueConstraint.get_by(type_id=_type_id, to_dict=False):
|
for item in CITypeUniqueConstraint.get_by(type_id=_type_id, to_dict=False):
|
||||||
|
@ -740,6 +737,9 @@ class CITypeAttributeManager(object):
|
||||||
item = CITypeTrigger.get_by(type_id=_type_id, attr_id=attr_id, to_dict=False, first=True)
|
item = CITypeTrigger.get_by(type_id=_type_id, attr_id=attr_id, to_dict=False, first=True)
|
||||||
item and item.soft_delete(commit=False)
|
item and item.soft_delete(commit=False)
|
||||||
|
|
||||||
|
for item in PreferenceShowAttributes.get_by(type_id=_type_id, attr_id=attr_id, to_dict=False):
|
||||||
|
item.soft_delete(commit=False)
|
||||||
|
|
||||||
for item in (CITypeRelation.get_by(parent_id=type_id, to_dict=False) +
|
for item in (CITypeRelation.get_by(parent_id=type_id, to_dict=False) +
|
||||||
CITypeRelation.get_by(child_id=type_id, to_dict=False)):
|
CITypeRelation.get_by(child_id=type_id, to_dict=False)):
|
||||||
if item.parent_id == type_id and attr_id in (item.parent_attr_ids or []):
|
if item.parent_id == type_id and attr_id in (item.parent_attr_ids or []):
|
||||||
|
|
Loading…
Reference in New Issue