From 2fe1947f4b0b5f06eb19892cb57b406094f7ed40 Mon Sep 17 00:00:00 2001
From: Dominik George <dominik.george@teckids.org>
Date: Tue, 16 Jul 2019 23:23:06 +0200
Subject: [PATCH] Fix assignment of n:m field.

---
 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 f985189..ac72d93 100644
--- a/biscuit/apps/untis/util.py
+++ b/biscuit/apps/untis/util.py
@@ -72,8 +72,8 @@ def untis_import_xml(request, untis_xml):
             'name': name})
 
         try:
-            class_.owners = [Person.objects.get(
-                short_name=class_teacher_short_name)]
+            class_.owners.set([Person.objects.get(
+                short_name=class_teacher_short_name)])
             class_.save()
         except Person.DoesNotExist:
             messages.warning(request, _('Could not set class teacher of %s to %s.') % (
-- 
GitLab