Skip to content

Commit

Permalink
feat: 规则审计-联表管理-后端接口 --story=121324647
Browse files Browse the repository at this point in the history
【修复】
1. 联表删除同时会删除联表标签
  • Loading branch information
0RAJA committed Jan 14, 2025
1 parent d0580c0 commit 30ba4d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backend/services/web/strategy_v2/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,13 @@ def perform_request(self, validated_request_data):
class DeleteLinkTable(LinkTableBase):
name = gettext_lazy("删除联表")

@transaction.atomic()
def perform_request(self, validated_request_data):
uid = validated_request_data["uid"]
# 如果有策略使用了该联表则不能删除
if Strategy.objects.filter(strategy_type=StrategyType.RULE, link_table_uid=uid).exists():
raise LinkTableHasStrategy()
LinkTableTag.objects.filter(link_table_uid=uid).delete()
LinkTable.objects.filter(uid=uid).delete()


Expand Down

0 comments on commit 30ba4d7

Please sign in to comment.