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
692a0692
Commit
692a0692
authored
3 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Create an action to mark personal notes as unexcused
parent
5e992e27
No related branches found
No related tags found
1 merge request
!111
Resolve "[Person overview] Implement multiple selection for marking absences as excused or for deleting"
Pipeline
#7094
failed
3 years ago
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/actions.py
+7
-0
7 additions, 0 deletions
aleksis/apps/alsijil/actions.py
aleksis/apps/alsijil/forms.py
+9
-2
9 additions, 2 deletions
aleksis/apps/alsijil/forms.py
with
16 additions
and
2 deletions
aleksis/apps/alsijil/actions.py
+
7
−
0
View file @
692a0692
...
...
@@ -19,6 +19,13 @@ def mark_as_excused(modeladmin, request, queryset):
mark_as_excused
.
short_description
=
_
(
"
Mark as excused
"
)
def
mark_as_unexcused
(
modeladmin
,
request
,
queryset
):
queryset
.
update
(
excused
=
False
,
excuse_type
=
None
)
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
)
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/forms.py
+
9
−
2
View file @
692a0692
...
...
@@ -20,7 +20,14 @@ from aleksis.apps.chronos.models import TimePeriod
from
aleksis.core.util.core_helpers
import
get_site_preferences
from
aleksis.core.util.predicates
import
check_global_permission
from
.actions
import
delete_personal_note
,
mark_as_excuse_type_generator
,
mark_as_excused
,
send_request_to_check_entry
from
.actions
import
(
delete_personal_note
,
mark_as_excuse_type_generator
,
mark_as_excused
,
mark_as_unexcused
,
send_request_to_check_entry
,
)
from
.models
import
(
ExcuseType
,
ExtraMark
,
...
...
@@ -178,7 +185,7 @@ class ExcuseTypeForm(forms.ModelForm):
class
PersonOverviewForm
(
ActionForm
):
def
get_actions
(
self
):
return
[
mark_as_excused
,
delete_personal_note
]
+
[
return
[
mark_as_excused
,
mark_as_unexcused
,
delete_personal_note
]
+
[
mark_as_excuse_type_generator
(
excuse_type
)
for
excuse_type
in
ExcuseType
.
objects
.
all
()
]
...
...
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