Remove raw IDs from some places

This commit is contained in:
2026-03-03 17:45:50 +00:00
parent 8ea2afb259
commit 506ea8a3b8
4 changed files with 87 additions and 69 deletions

View File

@@ -79,6 +79,7 @@ class CommandRoutingSettings(LoginRequiredMixin, View):
preview_profile_id = str(request.GET.get("preview_profile_id") or "").strip()
for profile in profiles:
policies = ensure_variant_policies_for_profile(profile)
profile.show_actions_editor = str(profile.slug or "").strip() != "bp"
if str(profile.slug or "").strip() == "bp":
keys = BP_VARIANT_KEYS
else:
@@ -172,6 +173,9 @@ class CommandRoutingSettings(LoginRequiredMixin, View):
action_type="extract_bp",
defaults={"enabled": True, "position": 0},
)
# Keep legacy action rows in storage for compatibility and for
# potential reuse by non-bp commands; bp UI now relies on
# variant policies instead of exposing the generic action matrix.
CommandAction.objects.get_or_create(
profile=profile,
action_type="save_document",

View File

@@ -683,6 +683,21 @@ class TaskGroupDetail(LoginRequiredMixin, View):
service__in=service_keys,
channel_identifier__in=variants,
).select_related("project", "epic")
mappings = list(mappings)
for row in mappings:
row_channel = _resolve_channel_display(
request.user,
str(getattr(row, "service", "") or ""),
str(getattr(row, "channel_identifier", "") or ""),
)
row.display_service_label = row_channel.get("service_label") or _service_label(
str(getattr(row, "service", "") or "")
)
row.display_channel_name = (
str(row_channel.get("display_name") or "").strip()
or str(channel.get("display_name") or "").strip()
or "Unknown chat"
)
tasks = (
DerivedTask.objects.filter(
user=request.user,