From 1395c04a001033bc0813e4ada4f509dc7e90f85f Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 27 Dec 2017 09:10:41 +0100 Subject: [PATCH] Add cache_control to CreateVirtualMachinesView and VirtualMachineView --- hosting/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index b6d65455..f43221c6 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -988,10 +988,12 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View): if (value > 2000) or (value < 10): raise ValidationError(_('Invalid storage size')) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def get(self, request, *args, **kwargs): context = {'templates': VMTemplate.objects.all()} return render(request, self.template_name, context) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request): cores = request.POST.get('cpu') cores_field = forms.IntegerField(validators=[self.validate_cores]) @@ -1114,6 +1116,7 @@ class VirtualMachineView(LoginRequiredMixin, View): return render(request, self.template_name, context) + @cache_control(no_cache=True, must_revalidate=True, no_store=True) def post(self, request, *args, **kwargs): response = {'status': False} admin_email_body = {}