diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dcfd0ee9e2cf5aaace4e4077289b4dbf07df6360..c0e2158397ef4e92c8fcd1288b75c9599e3c7366 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog`_, and this project adheres to `Semantic Versioning`_. +Unreleased +---------- + +Fixed +~~~~~ + +* Get validity ranges by Untis ID and the corresponding school term. + `2.0rc1`_ - 2021-06-23 ---------------------- diff --git a/aleksis/apps/untis/util/mysql/importers/terms.py b/aleksis/apps/untis/util/mysql/importers/terms.py index 3b981b665775d68f419ef5fceb251a44bf9c9c08..52687fbd0eaa9dc67e6112f1927738ac0fb4df4f 100644 --- a/aleksis/apps/untis/util/mysql/importers/terms.py +++ b/aleksis/apps/untis/util/mysql/importers/terms.py @@ -104,7 +104,9 @@ def import_terms(qs: Optional[QuerySet] = None,) -> Dict[int, chronos_models.Val school_term.save() try: - validity_range = chronos_models.ValidityRange.objects.get(import_ref_untis=term_id) + validity_range = chronos_models.ValidityRange.objects.get( + import_ref_untis=term_id, school_term=school_term + ) logger.info(" Validity range found by import reference.") except chronos_models.ValidityRange.DoesNotExist: try: