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
ebff52ea
Verified
Commit
ebff52ea
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Reformat
parent
9e0323c2
No related branches found
No related tags found
1 merge request
!92
Resolve "Add task for checking plausibility of data"
Pipeline
#4628
failed
4 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/data_checks.py
+4
-9
4 additions, 9 deletions
aleksis/apps/alsijil/data_checks.py
aleksis/apps/alsijil/models.py
+1
-2
1 addition, 2 deletions
aleksis/apps/alsijil/models.py
with
5 additions
and
11 deletions
aleksis/apps/alsijil/data_checks.py
+
4
−
9
View file @
ebff52ea
...
@@ -6,12 +6,7 @@ from django.utils.translation import gettext as _
...
@@ -6,12 +6,7 @@ from django.utils.translation import gettext as _
from
calendarweek
import
CalendarWeek
from
calendarweek
import
CalendarWeek
from
aleksis.core.data_checks
import
(
from
aleksis.core.data_checks
import
DATA_CHECK_REGISTRY
,
DataCheck
,
IgnoreSolveOption
,
SolveOption
DATA_CHECK_REGISTRY
,
DataCheck
,
IgnoreSolveOption
,
SolveOption
,
)
class
DeleteRelatedObjectSolveOption
(
SolveOption
):
class
DeleteRelatedObjectSolveOption
(
SolveOption
):
...
@@ -48,6 +43,7 @@ class NoPersonalNotesInCancelledLessonsDataCheck(DataCheck):
...
@@ -48,6 +43,7 @@ class NoPersonalNotesInCancelledLessonsDataCheck(DataCheck):
@classmethod
@classmethod
def
check_data
(
cls
):
def
check_data
(
cls
):
from
aleksis.core.models
import
DataCheckResult
from
aleksis.core.models
import
DataCheckResult
from
.models
import
PersonalNote
from
.models
import
PersonalNote
ct
=
ContentType
.
objects
.
get_for_model
(
PersonalNote
)
ct
=
ContentType
.
objects
.
get_for_model
(
PersonalNote
)
...
@@ -60,9 +56,7 @@ class NoPersonalNotesInCancelledLessonsDataCheck(DataCheck):
...
@@ -60,9 +56,7 @@ class NoPersonalNotesInCancelledLessonsDataCheck(DataCheck):
for
note
in
personal_notes
:
for
note
in
personal_notes
:
logging
.
info
(
f
"
Check personal note
{
note
}
"
)
logging
.
info
(
f
"
Check personal note
{
note
}
"
)
sub
=
note
.
lesson_period
.
get_substitution
(
sub
=
note
.
lesson_period
.
get_substitution
(
CalendarWeek
(
week
=
note
.
week
,
year
=
note
.
year
))
CalendarWeek
(
week
=
note
.
week
,
year
=
note
.
year
)
)
result
=
DataCheckResult
.
objects
.
get_or_create
(
result
=
DataCheckResult
.
objects
.
get_or_create
(
check
=
cls
.
name
,
content_type
=
ct
,
object_id
=
note
.
id
check
=
cls
.
name
,
content_type
=
ct
,
object_id
=
note
.
id
)
)
...
@@ -82,6 +76,7 @@ class NoGroupsOfPersonsSetInPersonalNotesDataCheck(DataCheck):
...
@@ -82,6 +76,7 @@ class NoGroupsOfPersonsSetInPersonalNotesDataCheck(DataCheck):
@classmethod
@classmethod
def
check_data
(
cls
):
def
check_data
(
cls
):
from
aleksis.core.models
import
DataCheckResult
from
aleksis.core.models
import
DataCheckResult
from
.models
import
PersonalNote
from
.models
import
PersonalNote
ct
=
ContentType
.
objects
.
get_for_model
(
PersonalNote
)
ct
=
ContentType
.
objects
.
get_for_model
(
PersonalNote
)
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/models.py
+
1
−
2
View file @
ebff52ea
...
@@ -101,8 +101,7 @@ class PersonalNote(ExtensibleModel, WeekRelatedMixin):
...
@@ -101,8 +101,7 @@ class PersonalNote(ExtensibleModel, WeekRelatedMixin):
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
(
return
(
reverse
(
reverse
(
"
lesson_by_week_and_period
"
,
"
lesson_by_week_and_period
"
,
args
=
[
self
.
year
,
self
.
week
,
self
.
lesson_period
.
pk
],
args
=
[
self
.
year
,
self
.
week
,
self
.
lesson_period
.
pk
],
)
)
+
"
#personal-notes
"
+
"
#personal-notes
"
)
)
...
...
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