Skip to content
Snippets Groups Projects
Verified Commit 51f317cb authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Drop usage of no-longer used match var in lessons importer

parent 9754df99
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* Matching for groups while importing lessons was broken in some cases.
`2.2`_ - 2022-04-10
-------------------
......
......@@ -139,7 +139,6 @@ def import_lessons(
if compare_m2m(course_classes, found_group.parent_groups.all()) and compare_m2m(
teachers, found_group.owners.all()
):
match = True
course_group = found_group
logger.info(
" Course group found by searching by parent groups, "
......@@ -147,7 +146,7 @@ def import_lessons(
)
if (
not match
not course_group
and get_site_preferences()["untis_mysql__course_groups_fuzzy_matching"]
):
if qs.count() != 1:
......@@ -158,16 +157,14 @@ def import_lessons(
else:
for found_group in qs:
if compare_m2m(teachers, found_group.owners.all()):
if match:
if course_group:
logger.warning(
" More than one course group found "
"by searching by parent groups, "
"teachers (owners) and subject (fuzzy matching mode)"
)
match = False
course_group = None
else:
match = True
course_group = found_group
logger.info(
" Course group found by searching by parent groups, "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment