Increase security and reformat
This commit is contained in:
@@ -32,7 +32,8 @@ def _legacy_defaults(profile: CommandProfile, post_result_enabled: bool) -> dict
|
||||
"enabled": True,
|
||||
"generation_mode": "ai",
|
||||
"send_plan_to_egress": bool(post_result_enabled),
|
||||
"send_status_to_source": str(profile.visibility_mode or "") == "status_in_source",
|
||||
"send_status_to_source": str(profile.visibility_mode or "")
|
||||
== "status_in_source",
|
||||
"send_status_to_egress": False,
|
||||
"store_document": True,
|
||||
}
|
||||
@@ -56,7 +57,9 @@ def ensure_variant_policies_for_profile(
|
||||
*,
|
||||
action_rows: Iterable[CommandAction] | None = None,
|
||||
) -> dict[str, CommandVariantPolicy]:
|
||||
actions = list(action_rows) if action_rows is not None else list(profile.actions.all())
|
||||
actions = (
|
||||
list(action_rows) if action_rows is not None else list(profile.actions.all())
|
||||
)
|
||||
post_result_enabled = any(
|
||||
row.action_type == "post_result" and bool(row.enabled) for row in actions
|
||||
)
|
||||
@@ -91,7 +94,9 @@ def ensure_variant_policies_for_profile(
|
||||
return result
|
||||
|
||||
|
||||
def load_variant_policy(profile: CommandProfile, variant_key: str) -> CommandVariantPolicy | None:
|
||||
def load_variant_policy(
|
||||
profile: CommandProfile, variant_key: str
|
||||
) -> CommandVariantPolicy | None:
|
||||
key = str(variant_key or "").strip()
|
||||
if not key:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user