Add cache_control decorator to all hosting views
This commit is contained in:
parent
dd54b3052e
commit
b4f03b9553
1 changed files with 18 additions and 2 deletions
|
@ -65,6 +65,7 @@ CONNECTION_ERROR = "Your VMs cannot be displayed at the moment due to a \
|
||||||
minutes."
|
minutes."
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class DashboardView(LoginRequiredMixin, View):
|
class DashboardView(LoginRequiredMixin, View):
|
||||||
template_name = "hosting/dashboard.html"
|
template_name = "hosting/dashboard.html"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -186,6 +187,7 @@ class HostingPricingView(ProcessVMSelectionMixin, View):
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class IndexView(View):
|
class IndexView(View):
|
||||||
template_name = "hosting/index.html"
|
template_name = "hosting/index.html"
|
||||||
|
|
||||||
|
@ -210,6 +212,7 @@ class IndexView(View):
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class LoginView(LoginViewMixin):
|
class LoginView(LoginViewMixin):
|
||||||
template_name = "hosting/login.html"
|
template_name = "hosting/login.html"
|
||||||
form_class = HostingUserLoginForm
|
form_class = HostingUserLoginForm
|
||||||
|
@ -310,6 +313,7 @@ class SignupValidatedView(SignupValidateView):
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class ResendActivationEmailView(ResendActivationLinkViewMixin):
|
class ResendActivationEmailView(ResendActivationLinkViewMixin):
|
||||||
template_name = 'hosting/resend_activation_link.html'
|
template_name = 'hosting/resend_activation_link.html'
|
||||||
form_class = ResendActivationEmailForm
|
form_class = ResendActivationEmailForm
|
||||||
|
@ -318,6 +322,7 @@ class ResendActivationEmailView(ResendActivationLinkViewMixin):
|
||||||
email_template_name = 'user_activation'
|
email_template_name = 'user_activation'
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class PasswordResetView(PasswordResetViewMixin):
|
class PasswordResetView(PasswordResetViewMixin):
|
||||||
site = 'dcl'
|
site = 'dcl'
|
||||||
template_name = 'hosting/reset_password.html'
|
template_name = 'hosting/reset_password.html'
|
||||||
|
@ -326,6 +331,7 @@ class PasswordResetView(PasswordResetViewMixin):
|
||||||
template_email_path = 'hosting/emails/'
|
template_email_path = 'hosting/emails/'
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class PasswordResetConfirmView(PasswordResetConfirmViewMixin):
|
class PasswordResetConfirmView(PasswordResetConfirmViewMixin):
|
||||||
template_name = 'hosting/confirm_reset_password.html'
|
template_name = 'hosting/confirm_reset_password.html'
|
||||||
success_url = reverse_lazy('hosting:login')
|
success_url = reverse_lazy('hosting:login')
|
||||||
|
@ -402,6 +408,7 @@ class MarkAsReadNotificationView(LoginRequiredMixin, UpdateView):
|
||||||
return HttpResponseRedirect(reverse('hosting:notifications'))
|
return HttpResponseRedirect(reverse('hosting:notifications'))
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class SSHKeyDeleteView(LoginRequiredMixin, DeleteView):
|
class SSHKeyDeleteView(LoginRequiredMixin, DeleteView):
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
success_url = reverse_lazy('hosting:ssh_keys')
|
success_url = reverse_lazy('hosting:ssh_keys')
|
||||||
|
@ -430,6 +437,7 @@ class SSHKeyDeleteView(LoginRequiredMixin, DeleteView):
|
||||||
return super(SSHKeyDeleteView, self).delete(request, *args, **kwargs)
|
return super(SSHKeyDeleteView, self).delete(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class SSHKeyListView(LoginRequiredMixin, ListView):
|
class SSHKeyListView(LoginRequiredMixin, ListView):
|
||||||
template_name = "hosting/user_keys.html"
|
template_name = "hosting/user_keys.html"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -450,6 +458,7 @@ class SSHKeyListView(LoginRequiredMixin, ListView):
|
||||||
**response_kwargs)
|
**response_kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class SSHKeyChoiceView(LoginRequiredMixin, View):
|
class SSHKeyChoiceView(LoginRequiredMixin, View):
|
||||||
template_name = "hosting/choice_ssh_keys.html"
|
template_name = "hosting/choice_ssh_keys.html"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -476,6 +485,7 @@ class SSHKeyChoiceView(LoginRequiredMixin, View):
|
||||||
return redirect(reverse_lazy('hosting:ssh_keys'), foo='bar')
|
return redirect(reverse_lazy('hosting:ssh_keys'), foo='bar')
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class SSHKeyCreateView(LoginRequiredMixin, FormView):
|
class SSHKeyCreateView(LoginRequiredMixin, FormView):
|
||||||
form_class = UserHostingKeyForm
|
form_class = UserHostingKeyForm
|
||||||
model = UserHostingKey
|
model = UserHostingKey
|
||||||
|
@ -538,6 +548,7 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView):
|
||||||
return self.form_invalid(form)
|
return self.form_invalid(form)
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class SettingsView(LoginRequiredMixin, FormView):
|
class SettingsView(LoginRequiredMixin, FormView):
|
||||||
template_name = "hosting/settings.html"
|
template_name = "hosting/settings.html"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -589,6 +600,7 @@ class SettingsView(LoginRequiredMixin, FormView):
|
||||||
return self.form_invalid(form)
|
return self.form_invalid(form)
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class PaymentVMView(LoginRequiredMixin, FormView):
|
class PaymentVMView(LoginRequiredMixin, FormView):
|
||||||
template_name = 'hosting/payment.html'
|
template_name = 'hosting/payment.html'
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -667,8 +679,8 @@ class PaymentVMView(LoginRequiredMixin, FormView):
|
||||||
return self.form_invalid(form)
|
return self.form_invalid(form)
|
||||||
|
|
||||||
|
|
||||||
class OrdersHostingDetailView(LoginRequiredMixin,
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
DetailView):
|
class OrdersHostingDetailView(LoginRequiredMixin, DetailView):
|
||||||
template_name = "hosting/order_detail.html"
|
template_name = "hosting/order_detail.html"
|
||||||
context_object_name = "order"
|
context_object_name = "order"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -881,6 +893,7 @@ class OrdersHostingDetailView(LoginRequiredMixin,
|
||||||
content_type="application/json")
|
content_type="application/json")
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class OrdersHostingListView(LoginRequiredMixin, ListView):
|
class OrdersHostingListView(LoginRequiredMixin, ListView):
|
||||||
template_name = "hosting/orders.html"
|
template_name = "hosting/orders.html"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -895,6 +908,7 @@ class OrdersHostingListView(LoginRequiredMixin, ListView):
|
||||||
return super(OrdersHostingListView, self).get_queryset()
|
return super(OrdersHostingListView, self).get_queryset()
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class OrdersHostingDeleteView(LoginRequiredMixin, DeleteView):
|
class OrdersHostingDeleteView(LoginRequiredMixin, DeleteView):
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
success_url = reverse_lazy('hosting:orders')
|
success_url = reverse_lazy('hosting:orders')
|
||||||
|
@ -939,6 +953,7 @@ class VirtualMachinesPlanListView(LoginRequiredMixin, ListView):
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class CreateVirtualMachinesView(LoginRequiredMixin, View):
|
class CreateVirtualMachinesView(LoginRequiredMixin, View):
|
||||||
template_name = "hosting/create_virtual_machine.html"
|
template_name = "hosting/create_virtual_machine.html"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
@ -1011,6 +1026,7 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View):
|
||||||
return redirect(reverse('hosting:payment'))
|
return redirect(reverse('hosting:payment'))
|
||||||
|
|
||||||
|
|
||||||
|
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||||
class VirtualMachineView(LoginRequiredMixin, View):
|
class VirtualMachineView(LoginRequiredMixin, View):
|
||||||
template_name = "hosting/virtual_machine_detail.html"
|
template_name = "hosting/virtual_machine_detail.html"
|
||||||
login_url = reverse_lazy('hosting:login')
|
login_url = reverse_lazy('hosting:login')
|
||||||
|
|
Loading…
Reference in a new issue