From 3fd99ebac7041fc536e40f0c4e099aca947dcbc2 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 21 Feb 2020 18:28:21 +0100 Subject: [PATCH] Ability to disable cache storage --- apps/member/views.py | 3 +++ apps/note/views.py | 5 +++++ templates/base.html | 3 +++ 3 files changed, 11 insertions(+) diff --git a/apps/member/views.py b/apps/member/views.py index 3570f7b2..6f982c64 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -249,6 +249,9 @@ class ClubAddMemberView(LoginRequiredMixin, CreateView): context = super().get_context_data(**kwargs) context['formset'] = MemberFormSet() context['helper'] = FormSetHelper() + + context['no_cache'] = True + return context def post(self, request, *args, **kwargs): diff --git a/apps/note/views.py b/apps/note/views.py index b012ad8b..c7e98ddc 100644 --- a/apps/note/views.py +++ b/apps/note/views.py @@ -28,6 +28,9 @@ class TransactionCreate(LoginRequiredMixin, CreateView): context = super().get_context_data(**kwargs) context['title'] = _('Transfer money from your account ' 'to one or others') + + context['no_cache'] = True + return context def get_form(self, form_class=None): @@ -146,6 +149,8 @@ class ConsoView(LoginRequiredMixin, CreateView): template_type=template_type) context['title'] = template_type + context['no_cache'] = True + return context def get_success_url(self): diff --git a/templates/base.html b/templates/base.html index 751ea96a..15ebef01 100644 --- a/templates/base.html +++ b/templates/base.html @@ -22,6 +22,9 @@ SPDX-License-Identifier: GPL-3.0-or-later + {% if no_cache %} + + {% endif %} {# Bootstrap CSS #}