From 98e06686f9a556614301a5605de12be4b100a7f7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 09:03:17 +0100 Subject: [PATCH] Add get method and cache_control to SignupValidatedView --- hosting/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 7d60d7b4..76be4a67 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -316,6 +316,12 @@ class SignupValidatedView(SignupValidateView): context['section_title'] = section_title return context + @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(reverse_lazy('hosting:dashboard')) + return super(SignupValidatedView, self).get(request, *args, **kwargs) + class ResendActivationEmailView(ResendActivationLinkViewMixin): template_name = 'hosting/resend_activation_link.html'