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
2b83f83b
Commit
2b83f83b
authored
4 years ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Add decorators to define which views not to cache
parent
69fa177d
No related branches found
No related tags found
1 merge request
!76
Draft: Resolve "Add PWA ignore path"
Pipeline
#4919
failed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/views.py
+9
-0
9 additions, 0 deletions
aleksis/apps/alsijil/views.py
with
9 additions
and
0 deletions
aleksis/apps/alsijil/views.py
+
9
−
0
View file @
2b83f83b
...
...
@@ -6,7 +6,9 @@ from django.db.models import Count, Exists, F, OuterRef, Q, Subquery, Sum
from
django.http
import
Http404
,
HttpRequest
,
HttpResponse
,
HttpResponseNotFound
from
django.shortcuts
import
get_object_or_404
,
redirect
,
render
from
django.urls
import
reverse
,
reverse_lazy
from
django.utils.decorators
import
method_decorator
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.cache
import
never_cache
from
calendarweek
import
CalendarWeek
from
django_tables2
import
RequestConfig
,
SingleTableView
...
...
@@ -427,6 +429,7 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
return
render
(
request
,
"
alsijil/print/full_register.html
"
,
context
)
@never_cache
def
register_absence
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
...
...
@@ -467,6 +470,7 @@ class ExtraMarkListView(SingleTableView, PermissionRequiredMixin):
template_name
=
"
alsijil/extra_mark/list.html
"
@method_decorator
(
never_cache
,
name
=
"
dispatch
"
)
class
ExtraMarkCreateView
(
AdvancedCreateView
,
PermissionRequiredMixin
):
"""
Create view for extra marks.
"""
...
...
@@ -478,6 +482,7 @@ class ExtraMarkCreateView(AdvancedCreateView, PermissionRequiredMixin):
success_message
=
_
(
"
The extra mark has been created.
"
)
@method_decorator
(
never_cache
,
name
=
"
dispatch
"
)
class
ExtraMarkEditView
(
AdvancedEditView
,
PermissionRequiredMixin
):
"""
Edit view for extra marks.
"""
...
...
@@ -489,6 +494,7 @@ class ExtraMarkEditView(AdvancedEditView, PermissionRequiredMixin):
success_message
=
_
(
"
The extra mark has been saved.
"
)
@method_decorator
(
never_cache
,
name
=
"
dispatch
"
)
class
ExtraMarkDeleteView
(
AdvancedDeleteView
,
PermissionRequiredMixin
,
RevisionMixin
):
"""
Delete view for extra marks
"""
...
...
@@ -508,6 +514,7 @@ class ExcuseTypeListView(SingleTableView, PermissionRequiredMixin):
template_name
=
"
alsijil/excuse_type/list.html
"
@method_decorator
(
never_cache
,
name
=
"
dispatch
"
)
class
ExcuseTypeCreateView
(
AdvancedCreateView
,
PermissionRequiredMixin
):
"""
Create view for excuse types.
"""
...
...
@@ -519,6 +526,7 @@ class ExcuseTypeCreateView(AdvancedCreateView, PermissionRequiredMixin):
success_message
=
_
(
"
The excuse type has been created.
"
)
@method_decorator
(
never_cache
,
name
=
"
dispatch
"
)
class
ExcuseTypeEditView
(
AdvancedEditView
,
PermissionRequiredMixin
):
"""
Edit view for excuse types.
"""
...
...
@@ -530,6 +538,7 @@ class ExcuseTypeEditView(AdvancedEditView, PermissionRequiredMixin):
success_message
=
_
(
"
The excuse type has been saved.
"
)
@method_decorator
(
never_cache
,
name
=
"
dispatch
"
)
class
ExcuseTypeDeleteView
(
AdvancedDeleteView
,
PermissionRequiredMixin
,
RevisionMixin
):
"""
Delete view for excuse types
"""
...
...
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