fix(tradein): PDF — рабочая ссылка на отчёт + «Есть/Нет» для балкона

«Этот отчёт онлайн» и QR-код в PDF вели на
gendsgn.ru/trade-in/trade-in?id=… — двойной /trade-in/: PUBLIC_URL
на проде уже = https://gendsgn.ru/trade-in, а код добавлял /trade-in
ещё раз → ссылка/QR давали 404.

Плюс «Балкон / лоджия» печатался как «1»/«0» (сырое булево) вместо
«Есть»/«Нет».
This commit is contained in:
Light1YT 2026-05-22 16:01:12 +05:00
parent 7a9b183296
commit 420057aa02

View file

@ -244,7 +244,7 @@ def _build_cover(
rooms_label = "Студия" if rooms == 0 else f"{rooms} комнат" + ("а" if rooms == 1 else "ы" if 2 <= rooms <= 4 else "")
house_label = house_labels.get(house_type, "") if house_type else ""
repair_label = repair_labels.get(repair_state, "Не указано") if repair_state else "Не указано"
balcony_label = "1" if has_balcony else "0" if has_balcony is False else ""
balcony_label = "Есть" if has_balcony else "Нет" if has_balcony is False else ""
# Active market subband — 4-118 days range (как у Брусники).
# Если есть days_on_market в analogs — берём min/max, иначе фиксированно.
@ -269,7 +269,7 @@ def _build_cover(
)
qr_url = _qr_code_data_url(
f"{settings.public_url}/trade-in?id={estimate.estimate_id}", size=3
f"{settings.public_url}?id={estimate.estimate_id}", size=3
)
return f"""
@ -332,7 +332,7 @@ def _build_cover(
</table>
<p style="margin-top:18pt;font-size:8pt;color:#6b7280;border-top:1pt solid #e6e8ec;padding-top:8pt;">
<strong>Этот отчёт онлайн:</strong> {settings.public_url}/trade-in?id={estimate.estimate_id}
<strong>Этот отчёт онлайн:</strong> {settings.public_url}?id={estimate.estimate_id}
</p>
</div>