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.
This commit is contained in:
Hugh Rundle 2022-01-07 13:13:56 +11:00
parent 602574566b
commit e4be6a98e8
No known key found for this signature in database
GPG key ID: CD23D6039184286B
2 changed files with 3 additions and 2 deletions

View file

@ -1,11 +1,13 @@
{% extends 'landing/layout.html' %}
{% load i18n %}
{% load cache %}
{% block panel %}
<div class="block is-hidden-tablet">
<h2 class="title has-text-centered">{% trans "Recent Books" %}</h2>
</div>
{% cache 60 * 60 %}
<section class="tile is-ancestor">
<div class="tile is-vertical is-6">
<div class="tile is-parent">
@ -46,5 +48,5 @@
</div>
</div>
</section>
{% endcache %}
{% endblock %}

View file

@ -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 = {