Add cache_control to PaymentVMView and OrdersHostingDetailView

This commit is contained in:
PCoder 2017-12-27 09:06:46 +01:00
parent ab06eeff67
commit 14ff876fbf

View file

@ -660,11 +660,13 @@ class PaymentVMView(LoginRequiredMixin, FormView):
return context return context
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
if 'next' in request.session: if 'next' in request.session:
del request.session['next'] del request.session['next']
return self.render_to_response(self.get_context_data()) return self.render_to_response(self.get_context_data())
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
form = self.get_form() form = self.get_form()
if form.is_valid(): if form.is_valid():
@ -792,6 +794,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView):
context['vm'] = self.request.session.get('specs') context['vm'] = self.request.session.get('specs')
return context return context
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
if not self.kwargs.get('pk'): if not self.kwargs.get('pk'):
if 'specs' not in self.request.session: if 'specs' not in self.request.session:
@ -813,6 +816,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView):
) )
return self.render_to_response(context) return self.render_to_response(context)
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
def post(self, request): def post(self, request):
template = request.session.get('template') template = request.session.get('template')
specs = request.session.get('specs') specs = request.session.get('specs')