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
4812fc8c
Verified
Commit
4812fc8c
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix actions for personal notes table to work only with correct items
parent
1ab60ec1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!217
Resolve "Actions for personal notes tables don't work as expected"
Pipeline
#24903
passed with warnings
3 years ago
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+2
-0
2 additions, 0 deletions
CHANGELOG.rst
aleksis/apps/alsijil/actions.py
+9
-4
9 additions, 4 deletions
aleksis/apps/alsijil/actions.py
with
11 additions
and
4 deletions
CHANGELOG.rst
+
2
−
0
View file @
4812fc8c
...
...
@@ -14,6 +14,8 @@ Fixed
* The lesson documentations tab was displayed on overviews for persons who are not teachers.
* Teachers weren't able to edit personal notes of their students in the person overview.
* The actions to mark absences as excused in the personal notes table also marked personal notes as excused which are not absences.
* The delete action in the personal notes table really deleted the items instead of just resetting them to default values.
`2.0rc3`_ - 2021-07-20
----------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/actions.py
+
9
−
4
View file @
4812fc8c
...
...
@@ -7,18 +7,19 @@ from django.template.loader import get_template
from
django.urls
import
reverse
from
django.utils.translation
import
gettext_lazy
as
_
from
aleksis.apps.alsijil.models
import
PersonalNote
from
aleksis.core.models
import
Notification
def
mark_as_excused
(
modeladmin
,
request
,
queryset
):
queryset
.
update
(
excused
=
True
,
excuse_type
=
None
)
queryset
.
filter
(
absent
=
True
).
update
(
excused
=
True
,
excuse_type
=
None
)
mark_as_excused
.
short_description
=
_
(
"
Mark as excused
"
)
def
mark_as_unexcused
(
modeladmin
,
request
,
queryset
):
queryset
.
update
(
excused
=
False
,
excuse_type
=
None
)
queryset
.
filter
(
absent
=
True
).
update
(
excused
=
False
,
excuse_type
=
None
)
mark_as_unexcused
.
short_description
=
_
(
"
Mark as unexcused
"
)
...
...
@@ -26,7 +27,7 @@ mark_as_unexcused.short_description = _("Mark as unexcused")
def
mark_as_excuse_type_generator
(
excuse_type
)
->
Callable
:
def
mark_as_excuse_type
(
modeladmin
,
request
,
queryset
):
queryset
.
update
(
excused
=
True
,
excuse_type
=
excuse_type
)
queryset
.
filter
(
absent
=
True
).
update
(
excused
=
True
,
excuse_type
=
excuse_type
)
mark_as_excuse_type
.
short_description
=
_
(
f
"
Mark as
{
excuse_type
.
name
}
"
)
mark_as_excuse_type
.
__name__
=
f
"
mark_as_excuse_type_
{
excuse_type
.
short_name
}
"
...
...
@@ -35,7 +36,11 @@ def mark_as_excuse_type_generator(excuse_type) -> Callable:
def
delete_personal_note
(
modeladmin
,
request
,
queryset
):
queryset
.
delete
()
notes
=
[]
for
personal_note
in
queryset
:
personal_note
.
reset_values
()
notes
.
append
(
personal_note
)
PersonalNote
.
objects
.
bulk_update
(
notes
)
delete_personal_note
.
short_description
=
_
(
"
Delete
"
)
...
...
This diff is collapsed.
Click to expand it.
Jonathan Weth
@hansegucker
mentioned in commit
3867579d
·
3 years ago
mentioned in commit
3867579d
mentioned in commit 3867579d48d1384af38d05a7cfa0b23150fa9c4b
Toggle commit list
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