fix: скрыт адрес до доклада бригады
This commit is contained in:
parent
f0c9015f2b
commit
5e8a0a7f09
2 changed files with 15 additions and 2 deletions
|
|
@ -172,6 +172,19 @@ def build_card(
|
|||
},
|
||||
)
|
||||
else:
|
||||
description_facts = scenario.facts[:3]
|
||||
if scenario.dds_card_error is not None:
|
||||
# Иначе верный адрес из вводной попадёт в описание ошибочной КИО
|
||||
# и курсант увидит расхождение до доклада бригады.
|
||||
description_facts = [
|
||||
fact for fact in scenario.facts
|
||||
if "address" not in fact.id.lower()
|
||||
and not address_matches(truth.address, fact.value)
|
||||
][:3]
|
||||
description = "; ".join(fact.value for fact in description_facts)
|
||||
if not description:
|
||||
description = ("Происшествие по выданной карточке"
|
||||
if scenario.dds_card_error is not None else scenario.first_line)
|
||||
kio = KIO(
|
||||
registered_at=now_utc(),
|
||||
caller_number=caller_phone,
|
||||
|
|
@ -190,8 +203,7 @@ def build_card(
|
|||
signs=list(scenario.signs),
|
||||
notify=scenario.notify_services(),
|
||||
victims_count=truth.victims,
|
||||
description="; ".join(fact.value for fact in scenario.facts[:3])
|
||||
or scenario.first_line,
|
||||
description=description,
|
||||
)
|
||||
if service:
|
||||
kio = apply_patch(kio, {"dds": service})
|
||||
|
|
|
|||
|
|
@ -844,6 +844,7 @@ def test_crew_discovers_card_address_error_and_dispatcher_reports_it_to_112(clie
|
|||
card = state.desk.active
|
||||
assert card.dispatched_card.address == "улица Ленина, 16"
|
||||
assert card.scenario.ground_truth.address == "улица Ленина, 14"
|
||||
assert "Ленина, 14" not in card.dispatched_card.description
|
||||
with client.websocket_connect(f"/ws/station/{session_id}") as station:
|
||||
service = accept_with_crew(station)
|
||||
station.send_json({
|
||||
|
|
|
|||
Loading…
Reference in a new issue