fix(board): Handle NULL proceedings/agenda_items in meeting view
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Meeting JSONB fields (proceedings, agenda_items) can be NULL for
meetings that haven't occurred yet. Add `or []` fallback to all
unguarded Jinja2 iterations to prevent TypeError on NoneType.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-04 11:41:43 +01:00
parent 09ef2b62a5
commit d855f36cc0

View File

@ -637,7 +637,7 @@
Przebieg posiedzenia i ustalenia
</h2>
{% for proc in meeting.proceedings %}
{% for proc in meeting.proceedings or [] %}
{% set agenda_item = meeting.agenda_items[proc.agenda_item] if meeting.agenda_items and proc.agenda_item < meeting.agenda_items|length else none %}
<div class="proceeding-item">
<h3>Ad. {{ proc.agenda_item + 1 }}. {{ agenda_item.title if agenda_item else 'Punkt programu' }}</h3>
@ -667,7 +667,7 @@ function printAgenda() {
// Collect agenda items
const agendaItems = [
{% for item in meeting.agenda_items %}
{% for item in meeting.agenda_items or [] %}
{ time: '{{ item.time_start }}{% if item.time_end %} - {{ item.time_end }}{% endif %}', title: '{{ item.title|e }}' },
{% endfor %}
];
@ -738,14 +738,14 @@ function printProtocol() {
// Collect agenda items
const agendaItems = [
{% for item in meeting.agenda_items %}
{% for item in meeting.agenda_items or [] %}
'{{ item.title|e }}',
{% endfor %}
];
// Collect proceedings
const proceedings = [
{% for proc in meeting.proceedings %}
{% for proc in meeting.proceedings or [] %}
{ index: {{ proc.agenda_item }}, discussed: `{{ proc.discussed|e|replace('\n', '\\n') }}`, decisions: `{{ proc.decisions|e|replace('\n', '\\n') }}` },
{% endfor %}
];