From 1c3ea3ec8805b847db0b1da4cea8cd5008d820f3 Mon Sep 17 00:00:00 2001 From: Michael Bauer <michael-bauer@posteo.de> Date: Tue, 5 Nov 2024 10:51:32 +0100 Subject: [PATCH] Properly provide group wrapped in list in template --- aleksis/apps/alsijil/tasks.py | 3 +++ .../alsijil/templates/alsijil/print/register_for_group.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aleksis/apps/alsijil/tasks.py b/aleksis/apps/alsijil/tasks.py index cb6c7c64e..eb7114632 100644 --- a/aleksis/apps/alsijil/tasks.py +++ b/aleksis/apps/alsijil/tasks.py @@ -125,6 +125,9 @@ def generate_full_register_printout( ), ) + if include_teachers_and_subjects_table: + group.as_list = [group] + if include_coursebook: group.documentations_by_day = {} documentations = documentations.order_by("datetime_start").prefetch_related( diff --git a/aleksis/apps/alsijil/templates/alsijil/print/register_for_group.html b/aleksis/apps/alsijil/templates/alsijil/print/register_for_group.html index 8b2f81108..7dfc22c6a 100644 --- a/aleksis/apps/alsijil/templates/alsijil/print/register_for_group.html +++ b/aleksis/apps/alsijil/templates/alsijil/print/register_for_group.html @@ -33,7 +33,7 @@ {% if include_teachers_and_subjects_table %} {% if group.courses %} <h4>{% trans 'Teachers and lessons in group' %} {{ group.name }}</h4> - {% include "alsijil/partials/register_teachers_and_subjects_table.html" with groups=[group] only %} + {% include "alsijil/partials/register_teachers_and_subjects_table.html" with groups=group.as_list only %} <div class="page-break"> </div> {% endif %} {% if group.child_groups %} -- GitLab