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
3cc3e69c
Commit
3cc3e69c
authored
2 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '46-fuzzy-matching-of-course-groups' into 'master'
Resolve "Fuzzy matching of course groups" Closes
#46
See merge request
!129
parents
50502d71
7f70d188
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!129
Resolve "Fuzzy matching of course groups"
Pipeline
#61096
canceled
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+6
-0
6 additions, 0 deletions
CHANGELOG.rst
aleksis/apps/untis/preferences.py
+9
-0
9 additions, 0 deletions
aleksis/apps/untis/preferences.py
aleksis/apps/untis/util/mysql/importers/lessons.py
+28
-0
28 additions, 0 deletions
aleksis/apps/untis/util/mysql/importers/lessons.py
with
43 additions
and
0 deletions
CHANGELOG.rst
+
6
−
0
View file @
3cc3e69c
...
...
@@ -9,6 +9,12 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Added
~~~~~
* Add fuzzy matching mode for searching course groups: If no 100 % match is found,
the importer will search a match by a subset of parent groups.
Changed
~~~~~~~
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/untis/preferences.py
+
9
−
0
View file @
3cc3e69c
...
...
@@ -91,6 +91,15 @@ class UseCourseGroups(BooleanPreference):
)
@site_preferences_registry.register
class
CourseGroupsFuzzyMatching
(
BooleanPreference
):
section
=
untis_mysql
name
=
"
course_groups_fuzzy_matching
"
default
=
False
verbose_name
=
_
(
"
Match course groups by a subset of parent groups if no 100% match is found
"
)
help_text
=
_
(
"
Works only if
'
Use course groups
'
is activated.
"
)
@site_preferences_registry.register
class
IgnoreIncompleteSubstitutions
(
BooleanPreference
):
section
=
untis_mysql
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/untis/util/mysql/importers/lessons.py
+
28
−
0
View file @
3cc3e69c
...
...
@@ -144,6 +144,34 @@ def import_lessons(
"
teachers (owners) and subject
"
)
if
(
not
match
and
get_site_preferences
()[
"
untis_mysql__course_groups_fuzzy_matching
"
]
):
if
qs
.
count
()
!=
1
:
logger
.
warning
(
"
Course group not found by searching by parent groups,
"
"
teachers (owners) and subject (fuzzy matching mode)
"
)
else
:
for
found_group
in
qs
:
if
compare_m2m
(
teachers
,
found_group
.
owners
.
all
()):
if
match
:
logger
.
warning
(
"
More than one course group found
"
"
by searching by parent groups,
"
"
teachers (owners) and subject (fuzzy matching mode)
"
)
match
=
False
course_group
=
None
else
:
match
=
True
course_group
=
found_group
logger
.
info
(
"
Course group found by searching by parent groups,
"
"
teachers (owners) and subject (fuzzy matching mode)
"
)
changed
=
False
if
not
match
:
# No matching group found
...
...
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