mirror of
https://github.com/veops/cmdb.git
synced 2025-08-09 22:26:09 +08:00
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:
@@ -722,9 +722,6 @@ class CITypeAttributeManager(object):
|
||||
|
||||
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)
|
||||
for _type_id in [type_id] + child_ids:
|
||||
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 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) +
|
||||
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 []):
|
||||
|
Reference in New Issue
Block a user