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
50502d71
Commit
50502d71
authored
2 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '45-take-teachers-into-account-when-matching-course-groups' into 'master'
Resolve "Take teachers into account when matching course groups" Closes
#45
See merge request
!128
parents
96b25680
8837b4ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!128
Resolve "Take teachers into account when matching course groups"
Pipeline
#60737
canceled
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+6
-0
6 additions, 0 deletions
CHANGELOG.rst
aleksis/apps/untis/util/mysql/importers/lessons.py
+7
-3
7 additions, 3 deletions
aleksis/apps/untis/util/mysql/importers/lessons.py
with
13 additions
and
3 deletions
CHANGELOG.rst
+
6
−
0
View file @
50502d71
...
...
@@ -15,6 +15,12 @@ Changed
* Let untis_import_mysql management command default to ``current`` instead of all
to prevent accidental imports of old plans
Fixed
~~~~~
* Search course groups not only by parent groups and subject, but also take
the teachers (group owners) into account
`2.1.3`_ - 2022-02-06
---------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/untis/util/mysql/importers/lessons.py
+
7
−
3
View file @
50502d71
...
...
@@ -124,20 +124,24 @@ def import_lessons(
# Negative import_ref denotes a course group
group_import_ref
=
-
int
(
"
{}{}
"
.
format
(
lesson_id
,
i
))
# Search by parent groups and subject
# Search by parent groups
, teachers/owners
and subject
qs
=
core_models
.
Group
.
objects
.
filter
(
parent_groups__in
=
[
c
.
id
for
c
in
course_classes
],
subject_id
=
subject
.
id
,
owners__in
=
[
t
.
id
for
t
in
teachers
],
).
filter
(
Q
(
school_term__isnull
=
True
)
|
Q
(
school_term
=
validity_range
.
school_term
))
# Check if found groups match
match
=
False
for
found_group
in
qs
:
if
compare_m2m
(
course_classes
,
found_group
.
parent_groups
.
all
()):
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 and subject
"
"
Course group found by searching by parent groups,
"
"
teachers (owners) and subject
"
)
changed
=
False
...
...
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