Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 规则审计-策略新增/编辑-后端接口 --story=121513458 #527

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/backend/services/web/strategy_v2/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ def perform_request(self, validated_request_data):
queryset = queryset.filter(
strategy_id__in=[s.strategy_id for s in resource.strategy_v2.list_has_update_strategy()]
)
if NO_TAG_ID in validated_request_data.get("tag", []):
validated_request_data["tag"] = [t for t in validated_request_data["tag"] if t != NO_TAG_ID]
queryset = queryset.exclude(strategy_id__in=StrategyTag.objects.values_list("strategy_id").distinct())
# tag filter
if validated_request_data.get("tag"):
# tag 筛选
Expand Down Expand Up @@ -1007,9 +1010,9 @@ def perform_request(self, validated_request_data):
{
"tag_name": str(NO_TAG_NAME),
"tag_id": NO_TAG_ID,
"link_table_count": LinkTable.objects.exclude(
uid__in=LinkTableTag.objects.values_list("link_table_uid").distinct()
).count(),
"link_table_count": LinkTable.list_max_version_link_table()
.exclude(uid__in=LinkTableTag.objects.values_list("link_table_uid").distinct())
.count(),
}
] + tag_count
# response
Expand Down
Loading