From c7969e420f3860b6ef90594c5f8838160d5a2142 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Sat, 14 Sep 2019 19:01:25 +0200 Subject: [PATCH] Fix determination of classes. Seriously, Untis - XML is well-structured format with schema validation and all this stuff, and you have no better idea than filling a free-form, space-separated list with values containing values? --- biscuit/apps/untis/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/biscuit/apps/untis/util.py b/biscuit/apps/untis/util.py index 7637eb2..f6fde92 100644 --- a/biscuit/apps/untis/util.py +++ b/biscuit/apps/untis/util.py @@ -94,8 +94,8 @@ def untis_import_xml(request: HttpRequest, untis_xml: Union[BinaryIO, str]) -> N subject_abbrev = get_child_node_id(lesson_node, 'lesson_subject')[3:] teacher_short_name = get_child_node_id( lesson_node, 'lesson_teacher')[3:] - group_short_names = [v[3:] for v in get_child_node_id( - lesson_node, 'lesson_classes').split(' ')] + group_short_names = [v for v in get_child_node_id( + lesson_node, 'lesson_classes').split('CL_') if v] effectivebegindate = get_child_node_text( lesson_node, 'effectivebegindate') effectiveenddate = get_child_node_text(lesson_node, 'effectiveenddate') -- GitLab