Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
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-Alsijil
Commits
1b44092a
Verified
Commit
1b44092a
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
[Data checks] Combine holiday queries to one big query
parent
eeb5f521
No related branches found
No related tags found
1 merge request
!92
Resolve "Add task for checking plausibility of data"
Pipeline
#5126
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/data_checks.py
+14
-12
14 additions, 12 deletions
aleksis/apps/alsijil/data_checks.py
with
14 additions
and
12 deletions
aleksis/apps/alsijil/data_checks.py
+
14
−
12
View file @
1b44092a
...
@@ -123,13 +123,14 @@ class LessonDocumentationOnHolidaysDataCheck(DataCheck):
...
@@ -123,13 +123,14 @@ class LessonDocumentationOnHolidaysDataCheck(DataCheck):
~
Q
(
topic
=
""
)
|
~
Q
(
group_note
=
""
)
|
~
Q
(
homework
=
""
)
~
Q
(
topic
=
""
)
|
~
Q
(
group_note
=
""
)
|
~
Q
(
homework
=
""
)
).
annotate
(
actual_date
=
weekday_to_date
)
).
annotate
(
actual_date
=
weekday_to_date
)
q
=
Q
()
for
holiday
in
holidays
:
for
holiday
in
holidays
:
docs_filtered_by_date
=
documentations
.
filter
(
q
=
q
|
Q
(
actual_date__gte
=
holiday
.
date_start
,
actual_date__lte
=
holiday
.
date_end
)
actual_date__gte
=
holiday
.
date_start
,
actual_date__lte
=
holiday
.
date_end
documentations
=
documentations
.
filter
(
q
)
)
for
doc
in
doc
s_filtered_by_date
:
for
doc
in
doc
umentations
:
logging
.
info
(
f
"
Lesson documentation
{
doc
}
is on holidays
"
)
logging
.
info
(
f
"
Lesson documentation
{
doc
}
is on holidays
"
)
cls
.
register_result
(
doc
)
cls
.
register_result
(
doc
)
class
PersonalNoteOnHolidaysDataCheck
(
DataCheck
):
class
PersonalNoteOnHolidaysDataCheck
(
DataCheck
):
...
@@ -158,13 +159,14 @@ class PersonalNoteOnHolidaysDataCheck(DataCheck):
...
@@ -158,13 +159,14 @@ class PersonalNoteOnHolidaysDataCheck(DataCheck):
~
Q
(
remarks
=
""
)
|
Q
(
absent
=
True
)
|
~
Q
(
late
=
0
)
|
Q
(
extra_marks__isnull
=
False
)
~
Q
(
remarks
=
""
)
|
Q
(
absent
=
True
)
|
~
Q
(
late
=
0
)
|
Q
(
extra_marks__isnull
=
False
)
).
annotate
(
actual_date
=
weekday_to_date
)
).
annotate
(
actual_date
=
weekday_to_date
)
q
=
Q
()
for
holiday
in
holidays
:
for
holiday
in
holidays
:
notes_filtered_by_date
=
personal_notes
.
filter
(
q
=
q
|
Q
(
actual_date__gte
=
holiday
.
date_start
,
actual_date__lte
=
holiday
.
date_end
)
actual_date__gte
=
holiday
.
date_start
,
actual_date__lte
=
holiday
.
date_end
personal_notes
=
personal_notes
.
filter
(
q
)
)
for
note
in
notes_filtered_by_da
te
:
for
note
in
personal_no
te
s
:
logging
.
info
(
f
"
Personal note
{
note
}
is on holidays
"
)
logging
.
info
(
f
"
Personal note
{
note
}
is on holidays
"
)
cls
.
register_result
(
note
)
cls
.
register_result
(
note
)
class
ExcusesWithoutAbsences
(
DataCheck
):
class
ExcusesWithoutAbsences
(
DataCheck
):
...
...
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