mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Fix caching
This commit is contained in:
@@ -32,4 +32,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
{% load humanize %}
|
||||
{% load paginator from filters %}
|
||||
{% load to_class_name from filters %}
|
||||
{% load cache %}
|
||||
|
||||
{% block content %}
|
||||
{% cache None feed_data request.user %}
|
||||
<div class="list-group-item">
|
||||
<div class="media">
|
||||
{% for version in object_list %}
|
||||
@@ -48,4 +50,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endcache %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -7,12 +7,11 @@ from PyRIGS.decorators import (api_key_required, has_oembed,
|
||||
permission_required_with_403)
|
||||
from RIGS import finance, ical, models, rigboard, views, hs
|
||||
from versioning import views
|
||||
from django.views.decorators.cache import cache_page
|
||||
from django.apps import apps
|
||||
|
||||
urlpatterns = [
|
||||
path('rigboard/activity/feed/',
|
||||
cache_page(60 * 10)(permission_required_with_403('RIGS.view_event')(views.ActivityFeed.as_view())),
|
||||
permission_required_with_403('RIGS.view_event')(views.ActivityFeed.as_view()),
|
||||
name='activity_feed'),
|
||||
]
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from django.apps import apps
|
||||
from reversion import revisions as reversion
|
||||
from versioning.versioning import RIGSVersion
|
||||
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.views.decorators.cache import never_cache, cache_page
|
||||
from django.utils.decorators import method_decorator
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ class ActivityTable(generic.ListView):
|
||||
return context
|
||||
|
||||
|
||||
@method_decorator(never_cache, name='dispatch') # Disable browser based caching
|
||||
class ActivityFeed(generic.ListView): # Appears on homepage
|
||||
model = RIGSVersion
|
||||
template_name = "activity_feed_data.html"
|
||||
|
||||
Reference in New Issue
Block a user