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
107538ef
Verified
Commit
107538ef
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Use school term for filter only if existing
parent
22f54ea2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!262
Use school term for filter only if existing
Pipeline
#49855
passed
3 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/filters.py
+6
-3
6 additions, 3 deletions
aleksis/apps/alsijil/filters.py
with
6 additions
and
3 deletions
aleksis/apps/alsijil/filters.py
+
6
−
3
View file @
107538ef
...
@@ -9,15 +9,18 @@ from .models import PersonalNote
...
@@ -9,15 +9,18 @@ from .models import PersonalNote
class
PersonalNoteFilter
(
FilterSet
):
class
PersonalNoteFilter
(
FilterSet
):
day_start
=
DateFilter
(
day_start
=
DateFilter
(
lookup_expr
=
"
gte
"
,
label
=
_
(
"
After
"
))
lookup_expr
=
"
gte
"
,
label
=
_
(
"
After
"
),
initial
=
SchoolTerm
.
current
.
date_start
)
day_end
=
DateFilter
(
lookup_expr
=
"
lte
"
,
label
=
_
(
"
Before
"
))
day_end
=
DateFilter
(
lookup_expr
=
"
lte
"
,
label
=
_
(
"
Before
"
))
subject
=
CharFilter
(
lookup_expr
=
"
icontains
"
,
label
=
_
(
"
Subject
"
))
subject
=
CharFilter
(
lookup_expr
=
"
icontains
"
,
label
=
_
(
"
Subject
"
))
def
__init__
(
self
,
data
=
None
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
data
=
None
,
*
args
,
**
kwargs
):
if
data
is
not
None
:
if
data
is
not
None
:
data
=
data
.
copy
()
data
=
data
.
copy
()
current_school_term
=
SchoolTerm
.
current
if
not
data
.
get
(
"
day_start
"
)
and
current_school_term
:
data
[
"
day_start
"
]
=
current_school_term
.
date_start
for
name
,
f
in
self
.
base_filters
.
items
():
for
name
,
f
in
self
.
base_filters
.
items
():
initial
=
f
.
extra
.
get
(
"
initial
"
)
initial
=
f
.
extra
.
get
(
"
initial
"
)
if
not
data
.
get
(
name
)
and
initial
:
if
not
data
.
get
(
name
)
and
initial
:
...
...
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