Add get method to hosting.SignupView and cache_control

This commit is contained in:
PCoder 2017-12-27 08:33:53 +01:00
parent 87cdb08f3c
commit bec541c06a
1 changed files with 6 additions and 0 deletions

View File

@ -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"