From 9a0d74c18bfc57eb7a546c4eed2ea6e653f97899 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <yohann.danello@gmail.com>
Date: Fri, 21 Feb 2020 19:46:56 +0100
Subject: [PATCH] Fix no cache in ConsoView

---
 apps/note/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/note/views.py b/apps/note/views.py
index c7e98ddc..9a23a231 100644
--- a/apps/note/views.py
+++ b/apps/note/views.py
@@ -140,6 +140,8 @@ class ConsoView(LoginRequiredMixin, CreateView):
         context = super().get_context_data(**kwargs)
         context['template_types'] = TransactionCategory.objects.all()
 
+        context['no_cache'] = True
+
         if 'template_type' not in self.kwargs.keys():
             return context
 
@@ -149,8 +151,6 @@ class ConsoView(LoginRequiredMixin, CreateView):
             template_type=template_type)
         context['title'] = template_type
 
-        context['no_cache'] = True
-
         return context
 
     def get_success_url(self):
-- 
GitLab