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
da7fafa6
Verified
Commit
da7fafa6
authored
3 years ago
by
Lloyd Meins
Browse files
Options
Downloads
Patches
Plain Diff
Show in my overview for teachers the missing entries as a default
parent
50a89067
No related branches found
No related tags found
1 merge request
!183
Resolve "Add page "Missing entries""
Pipeline
#10042
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/forms.py
+4
-2
4 additions, 2 deletions
aleksis/apps/alsijil/forms.py
aleksis/apps/alsijil/views.py
+2
-2
2 additions, 2 deletions
aleksis/apps/alsijil/views.py
with
6 additions
and
4 deletions
aleksis/apps/alsijil/forms.py
+
4
−
2
View file @
da7fafa6
...
...
@@ -275,13 +275,14 @@ class FilterRegisterObjectForm(forms.Form):
date_end
=
forms
.
DateField
(
label
=
_
(
"
End date
"
))
@classmethod
def
get_initial
(
cls
):
def
get_initial
(
cls
,
has_documentation
=
None
):
date_end
=
timezone
.
now
().
date
()
date_start
=
date_end
-
timedelta
(
days
=
30
)
return
{
"
school_term
"
:
SchoolTerm
.
current
,
"
date_start
"
:
date_start
,
"
date_end
"
:
date_end
,
"
has_documentation
"
:
has_documentation
,
}
def
__init__
(
...
...
@@ -289,13 +290,14 @@ class FilterRegisterObjectForm(forms.Form):
request
:
HttpRequest
,
*
args
,
for_person
:
bool
=
True
,
default_documentation
:
Optional
[
bool
]
=
None
,
groups
:
Optional
[
Sequence
[
Group
]]
=
None
,
**
kwargs
):
self
.
request
=
request
person
=
self
.
request
.
user
.
person
kwargs
[
"
initial
"
]
=
self
.
get_initial
()
kwargs
[
"
initial
"
]
=
self
.
get_initial
(
has_documentation
=
default_documentation
)
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
fields
[
"
school_term
"
].
queryset
=
SchoolTerm
.
objects
.
all
()
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
2
−
2
View file @
da7fafa6
...
...
@@ -946,8 +946,8 @@ def overview_person(request: HttpRequest, id_: Optional[int] = None) -> HttpResp
context
[
"
extra_marks
"
]
=
extra_marks
# Build filter with own form and logic as django-filter can't work with different models
filter_form
=
FilterRegisterObjectForm
(
request
,
request
.
GET
or
None
,
for_person
=
True
)
filter_dict
=
filter_form
.
cleaned_data
if
filter_form
.
is_valid
()
else
{}
filter_form
=
FilterRegisterObjectForm
(
request
,
request
.
GET
or
None
,
for_person
=
True
,
default_documentation
=
False
)
filter_dict
=
filter_form
.
cleaned_data
if
filter_form
.
is_valid
()
else
{
"
has_documentation
"
:
False
}
filter_dict
[
"
person
"
]
=
person
context
[
"
filter_form
"
]
=
filter_form
...
...
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