Skip to content
Snippets Groups Projects
Commit 6dc2389d authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'prepare-release-2.0rc3' into 'release/2.0'

Prepare release 2.0rc3

See merge request !88
parents a4a3e35e f8394f49
No related branches found
No related tags found
1 merge request!88Prepare release 2.0rc3
Pipeline #34328 passed
......@@ -6,6 +6,15 @@ 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`_.
`2.0rc3`_ - 2021-09-30
----------------------
Fixed
~~~~~
* Skip extra lessons without a subject.
* Fix problems with lesson parts without a room and lesson parts with two courses and one teacher in a room.
`2.0rc2`_ - 2021-07-30
----------------------
......@@ -100,3 +109,4 @@ Fixed
.. _2.0b0: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-Untis/-/tags/2.0b0
.. _2.0rc1: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-Untis/-/tags/2.0rc1
.. _2.0rc2: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-Untis/-/tags/2.0rc2
.. _2.0rc3: https://edugit.org/Teckids/AlekSIS/AlekSIS-App-Untis/-/tags/2.0rc3
......@@ -63,12 +63,16 @@ def import_lessons(
for el in raw_time_data_2:
weekday = int(el[1]) - 1
hour = int(el[2])
room_ids = untis_split_third(el[3], conv=int)
room_ids = list(filter(lambda r: r != "", el[3].split(";")))
# Get rooms
rooms = []
for room_id in room_ids:
r = rooms_ref[room_id]
if room_id and room_id != "0":
room_id = int(room_id)
r = rooms_ref[room_id]
else:
r = None
rooms.append(r)
# Get time period
......@@ -81,6 +85,8 @@ def import_lessons(
for el in raw_lesson_data:
raw_lesson_data_2.append(el.split("~"))
use_room_idx = 0
current_teacher_id = None
# All part lessons (courses)
for i, el in enumerate(raw_lesson_data_2):
logger.info(" Lesson part {}".format(i))
......@@ -105,6 +111,9 @@ def import_lessons(
logger.warning(_(" Skip because missing subject"))
continue
if current_teacher_id and current_teacher_id != teacher_id:
use_room_idx += 1
# Get classes
course_classes = []
for class_id in class_ids:
......@@ -235,8 +244,8 @@ def import_lessons(
# Get room if provided
rooms = rooms_per_periods[j]
if i < len(rooms):
room = rooms[i]
if use_room_idx < len(rooms):
room = rooms[use_room_idx]
else:
room = None
......@@ -259,6 +268,8 @@ def import_lessons(
)
logger.info(" New time period added")
current_teacher_id = teacher_id
for lesson in chronos_models.Lesson.objects.filter(validity=validity_range):
if lesson.lesson_id_untis and lesson.lesson_id_untis not in existing_lessons:
logger.info("Lesson {} deleted".format(lesson.id))
......
......@@ -180,6 +180,10 @@ def import_substitutions(
if not teacher_new and not teacher_old:
teachers = []
if not subject:
logger.warning(" Skip because missing subject")
continue
(extra_lesson, created,) = (
chronos_models.ExtraLesson.objects.select_related(None)
.prefetch_related(None)
......
This diff is collapsed.
[tool.poetry]
name = "AlekSIS-App-Untis"
version = "2.0rc2"
version = "2.0rc3"
packages = [
{ include = "aleksis" }
]
......
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