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
dbf97a5a
Verified
Commit
dbf97a5a
authored
2 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix import of supervisions for non-existing breaks
parent
e2b11be6
No related branches found
No related tags found
1 merge request
!214
Fix import of supervisions for non-existing breaks
Pipeline
#194946
failed
2 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/untis/util/mysql/importers/common_data.py
+7
-2
7 additions, 2 deletions
aleksis/apps/untis/util/mysql/importers/common_data.py
with
7 additions
and
2 deletions
aleksis/apps/untis/util/mysql/importers/common_data.py
+
7
−
2
View file @
dbf97a5a
...
...
@@ -386,13 +386,18 @@ def import_supervision_areas(
weekday
=
int
(
raw_supervision_2
[
2
])
-
1
before_period_number
=
int
(
raw_supervision_2
[
3
])
teacher
=
teachers_ref
[
teacher_id
]
slot
=
breaks_ref
[
weekday
][
before_period_number
]
logger
.
info
(
f
"
Import supervision on weekday
{
weekday
}
before the
"
f
"
{
before_period_number
}
. period (teacher
{
teacher
}
)
"
)
slot
=
breaks_ref
.
get
(
weekday
,
{}).
get
(
before_period_number
)
if
not
slot
:
logger
.
warning
(
"
Skip supervision as slot doesn
'
t exist.
"
)
continue
# Get or create
possible_supervisions
=
lesrooster_models
.
Supervision
.
objects
.
filter
(
break_slot
=
slot
,
...
...
@@ -449,7 +454,7 @@ def import_supervision_areas(
with
create_revision
():
set_comment
(
_
(
"
Deleted by Untis import
"
))
supervision
.
delete
()
logger
.
info
(
f
"
Supervision
{
supervision
}
deleted
"
)
logger
.
info
(
f
"
Supervision
{
supervision
.
id
}
deleted
"
)
ref
[
import_ref
]
=
{
"
area
"
:
new_area
,
"
supervisions
"
:
supervisions_ref
}
...
...
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