From bec541c06a4b574d7ccc6b53d44e2f65e3570a18 Mon Sep 17 00:00:00 2001
From: PCoder <purple.coder@yahoo.co.uk>
Date: Wed, 27 Dec 2017 08:33:53 +0100
Subject: [PATCH] Add get method to hosting.SignupView and cache_control

---
 hosting/views.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hosting/views.py b/hosting/views.py
index 02e30808..7d60d7b4 100644
--- a/hosting/views.py
+++ b/hosting/views.py
@@ -239,6 +239,12 @@ class SignupView(CreateView):
 
         return HttpResponseRedirect(reverse_lazy('hosting:signup-validate'))
 
+    @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())
+        return super(SignupView, self).get(request, *args, **kwargs)
+
 
 class SignupValidateView(TemplateView):
     template_name = "hosting/signup_validate.html"