From 72baa3635bad0f94712f284d9b4abb3a7bb8b3ec Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 08:31:19 +0100 Subject: [PATCH] Add cache_control decorator to LoginViewMixin --- utils/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/views.py b/utils/views.py index 6e54cde6..394a9fc2 100644 --- a/utils/views.py +++ b/utils/views.py @@ -8,6 +8,7 @@ from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.utils.translation import ugettext_lazy as _ from django.views.generic import FormView, CreateView +from django.views.decorators.cache import cache_control from membership.models import CustomUser from .forms import SetPasswordForm @@ -57,6 +58,7 @@ class LoginViewMixin(FormView): return HttpResponseRedirect(self.get_success_url()) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): if self.request.user.is_authenticated(): return HttpResponseRedirect(self.get_success_url())