Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Untis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Untis
Commits
2fde0c70
Commit
2fde0c70
authored
2 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '57-importing-exams-broken-due-to-missing-time-period' into 'master'
Resolve "Importing exams broken due to missing time period" Closes
#57
See merge request
!159
parents
4a943a58
03ab8d05
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!159
Resolve "Importing exams broken due to missing time period"
Pipeline
#94942
canceled
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
aleksis/apps/untis/util/mysql/importers/exams.py
+8
-5
8 additions, 5 deletions
aleksis/apps/untis/util/mysql/importers/exams.py
with
9 additions
and
5 deletions
CHANGELOG.rst
+
1
−
0
View file @
2fde0c70
...
...
@@ -13,6 +13,7 @@ Fixed
~~~~~
* Importer failed sometimes on progressing absences.
* Exam import failed sometimes when data provided through Untis were incomplete.
`2.3.2`_ - 2022-09-01
---------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/untis/util/mysql/importers/exams.py
+
8
−
5
View file @
2fde0c70
...
...
@@ -50,8 +50,8 @@ def import_exams(
logger
.
info
(
"
Import exam {}
"
.
format
(
import_ref
))
# Build values
title
=
exam
.
name
comment
=
exam
.
text
title
=
exam
.
name
or
""
comment
=
exam
.
text
or
""
day
=
untis_date_to_date
(
exam
.
date
)
period_from
=
exam
.
lessonfrom
...
...
@@ -90,6 +90,9 @@ def import_exams(
subject
=
subjects_ref
[
subject_id
]
first
=
False
period
=
int
(
el
[
4
])
if
not
period
:
logger
.
warning
(
"
Skip incomplete exam element
"
)
continue
period
=
time_periods_ref
[
weekday
][
period
]
teacher_id
=
int
(
el
[
5
])
room_id
=
int
(
el
[
6
])
...
...
@@ -97,8 +100,8 @@ def import_exams(
room
=
rooms_ref
[
room_id
]
exams
.
append
((
period
,
teacher
,
room
))
if
not
lesson
or
not
subject
:
logger
.
warning
(
f
"
Skip exam
{
import_ref
}
due to missing data.
"
)
if
not
lesson
or
not
subject
or
not
exams
:
logger
.
warning
(
"
Skip exam due to missing data.
"
)
continue
new_exam
,
created
=
chronos_models
.
Exam
.
objects
.
update_or_create
(
...
...
@@ -162,5 +165,5 @@ def import_exams(
validity_range
.
date_start
,
validity_range
.
date_end
):
if
e
.
import_ref_untis
and
e
.
import_ref_untis
not
in
existing_exams
:
logger
.
info
(
"
e
xam {} deleted
"
.
format
(
e
.
id
)
)
logger
.
info
(
f
"
E
xam
{
e
.
id
}
deleted
"
)
e
.
delete
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment