def process_view(self, request, view_func, view_args, view_kwargs): if not self.is_whitelisted(request.path_info) \ and hasattr(request, "user") \ and request.user.is_authenticated and \ not legal_acceptance(request.user): return terms_accepted(view_func)(request, *view_args, **view_kwargs)
def wrapped(request, *args, **kwargs): if not legal_acceptance(request.user): redirect_to = '{path:s}?next={next:s}'.format( path=TERMS_AND_CONDITIONS_AGREEMENT, next=request.path) return redirect(redirect_to, *args, **kwargs) else: return func(request, *args, **kwargs)
def wrapped(request, *args, **kwargs): if not legal_acceptance(request.user): return redirect( get(settings, "AGREEMENT_FORM", DEFAULT_AGREEMENT_FORM), *args, **kwargs) else: return func(request, *args, **kwargs)
def process_view(self, request, view_func, view_args, view_kwargs): # We don't redirect the current user to the legal acceptance page if: # 1. the current path is whitelisted, # 2. the current user is impersonating another user, # 3. the latest T&C were already accepted by the current user. if ( not self.is_whitelisted(request.path_info) and hasattr(request, "user") and request.user.is_authenticated() and not request.user.is_masked and not legal_acceptance(request.user)): return ensure_terms_accepted(view_func)(request, *view_args, **view_kwargs)
def wrapped(request, *args, **kwargs): if not legal_acceptance(request.user): return redirect(TERMS_AND_CONDITIONS_AGREEMENT, *args, **kwargs) else: return func(request, *args, **kwargs)