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
3c99004a
Verified
Commit
3c99004a
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Add missing reset solve option for data checks
parent
f42357a6
No related branches found
No related tags found
1 merge request
!92
Resolve "Add task for checking plausibility of data"
Pipeline
#5007
failed
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
-4
14 additions, 4 deletions
aleksis/apps/alsijil/data_checks.py
with
14 additions
and
4 deletions
aleksis/apps/alsijil/data_checks.py
+
14
−
4
View file @
3c99004a
...
...
@@ -32,6 +32,18 @@ class SetGroupsWithCurrentGroupsSolveOption(SolveOption):
check_result
.
delete
()
class
ResetPersonalNoteSolveOption
(
SolveOption
):
name
=
"
reset_personal_note
"
verbose_name
=
_
(
"
Reset personal note to defaults
"
)
@classmethod
def
solve
(
cls
,
check_result
:
"
DataCheckResult
"
):
note
=
check_result
.
related_object
note
.
reset_values
()
note
.
save
()
check_result
.
delete
()
@DATA_CHECK_REGISTRY.register
class
NoPersonalNotesInCancelledLessonsDataCheck
(
DataCheck
):
name
=
"
no_personal_notes_in_cancelled_lessons
"
...
...
@@ -175,8 +187,7 @@ class ExcusesWithoutAbsences(DataCheck):
verbose_name
=
_
(
"
Ensure that there are no excused personal notes without an absence
"
)
problem_name
=
_
(
"
The personal note is marked as excused, but not as absent.
"
)
solve_options
=
{
DeleteRelatedObjectSolveOption
.
name
:
DeleteRelatedObjectSolveOption
,
# FIXME OPTION
ResetPersonalNoteSolveOption
.
name
:
ResetPersonalNoteSolveOption
,
IgnoreSolveOption
.
name
:
IgnoreSolveOption
,
}
...
...
@@ -188,8 +199,7 @@ class ExcusesWithoutAbsences(DataCheck):
ct
=
ContentType
.
objects
.
get_for_model
(
PersonalNote
)
personal_notes
=
PersonalNote
.
objects
.
filter
(
excused
=
True
,
absent
=
False
)
personal_notes
=
PersonalNote
.
objects
.
filter
(
excused
=
True
,
absent
=
False
)
for
note
in
personal_notes
:
logging
.
info
(
f
"
Check personal note
{
note
}
"
)
...
...
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