fix(backend): PATCH technique_ids returns 503 when MITRE bundle not loaded
Added bundle-loaded guard in _resolve_technique_ids() before attempting any lookup; matches behavior of GET /api/mitre/matrix and GET /api/mitre/techniques. Added corresponding test case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,9 @@ def _resolve_technique_ids(
|
||||
"""
|
||||
from backend.app.services import mitre as mitre_svc
|
||||
|
||||
if not mitre_svc.mitre_loaded:
|
||||
return None, (jsonify({"error": "mitre bundle not loaded"}), 503)
|
||||
|
||||
# Dedup, preserve order.
|
||||
seen: dict[str, None] = dict.fromkeys(technique_ids)
|
||||
resolved: list[dict[str, str]] = []
|
||||
|
||||
Reference in New Issue
Block a user