From e4be6a98e8263983c96b696bc63227cf259049f5 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Fri, 7 Jan 2022 13:13:56 +1100 Subject: [PATCH] do not cache registration form Fixes #1777 Caching the Landing view also caches the registration form, including the CSRF value. This moves the caching into the recently reviewed books landing template which is presumably what we're trying to cache here, instead of caching the whole view. NOTE: this fixes the problem with registration, I haven't done enough testing to be sure it actually still caches the recent reviews data. --- bookwyrm/templates/landing/landing.html | 4 +++- bookwyrm/views/landing/landing.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/landing/landing.html b/bookwyrm/templates/landing/landing.html index d13cd582a..759e8c619 100644 --- a/bookwyrm/templates/landing/landing.html +++ b/bookwyrm/templates/landing/landing.html @@ -1,11 +1,13 @@ {% extends 'landing/layout.html' %} {% load i18n %} +{% load cache %} {% block panel %}

{% trans "Recent Books" %}

+{% cache 60 * 60 %}
@@ -46,5 +48,5 @@
- +{% endcache %} {% endblock %} diff --git a/bookwyrm/views/landing/landing.py b/bookwyrm/views/landing/landing.py index 74b5ee513..5839731d5 100644 --- a/bookwyrm/views/landing/landing.py +++ b/bookwyrm/views/landing/landing.py @@ -33,7 +33,6 @@ class Home(View): class Landing(View): """preview of recently reviewed books""" - @method_decorator(cache_page(60 * 60), name="dispatch") def get(self, request): """tiled book activity page""" data = {