def dispatch(self, request, *args, **kwargs): """ Override dispatch to do some checks before displaying form """ # quick hack to show sample customer response form with known test win if request.path.endswith('sample/'): kwargs['win_id'] = os.getenv('SAMPLE_WIN', 'notconfigured') self.kwargs['win_id'] = kwargs['win_id'] self.sample = True try: self.win_dict = self._get_valid_win(kwargs["win_id"], request) except self.SecurityException as e: return self._deny_access(request, message=str(e)) return FormView.dispatch(self, request, *args, **kwargs)
def dispatch(self, request, *args, **kwargs): if "travels" not in request.session: return redirect("transportation-itinerary") self.order_num = kwargs.get("order_num", None) return FormView.dispatch(self, request, *args, **kwargs)
def dispatch(self, request, *args, **kwargs): return FormView.dispatch(self, request, *args, **kwargs)
def dispatch(self, request, *args, **kwargs): if request.user.is_authenticated(): return redirect('upload') return FormView.dispatch(self, request, *args, **kwargs)