def _inner(request, *args, **kwargs): couch_user = _ensure_request_couch_user(request) if (couch_user and (allow_cc_users or couch_user.is_web_user())): clear_login_attempts(couch_user) return fn(request, *args, **kwargs) else: return HttpResponseForbidden()
def post(self, request, *args, **kwargs): self.extra_context['hide_password_feedback'] = settings.ENABLE_DRACONIAN_SECURITY_FEATURES response = super().post(request, *args, **kwargs) uidb64 = kwargs.get('uidb64') uid = urlsafe_base64_decode(uidb64) user = User.objects.get(pk=uid) couch_user = CouchUser.from_django_user(user) clear_login_attempts(couch_user) return response
def post(self, request, *args, **kwargs): self.extra_context['hide_password_feedback'] = has_custom_clean_password() response = super().post(request, *args, **kwargs) uidb64 = kwargs.get('uidb64') uid = urlsafe_base64_decode(uidb64) user = User.objects.get(pk=uid) couch_user = CouchUser.from_django_user(user) clear_login_attempts(couch_user) return response
def _inner(request, domain, *args, **kwargs): request.couch_user = couch_user = CouchUser.from_django_user( request.user) if (couch_user and (allow_cc_users or couch_user.is_web_user()) and couch_user.is_member_of(domain)): clear_login_attempts(couch_user) return fn(request, domain, *args, **kwargs) else: return HttpResponseForbidden()
def post(self, request, *args, **kwargs): extra_context = kwargs.setdefault('extra_context', {}) extra_context['hide_password_feedback'] = settings.ENABLE_DRACONIAN_SECURITY_FEATURES response = password_reset_confirm(request, *args, **kwargs) uidb64 = kwargs.get('uidb64') uid = urlsafe_base64_decode(uidb64) user = User.objects.get(pk=uid) couch_user = CouchUser.from_django_user(user) clear_login_attempts(couch_user) return response
def _inner(request, domain, *args, **kwargs): couch_user = _ensure_request_couch_user(request) if (couch_user and (allow_cc_users or couch_user.is_web_user()) and couch_user.is_member_of(domain, allow_mirroring=True)): clear_login_attempts(couch_user) return fn(request, domain, *args, **kwargs) else: return HttpResponseForbidden()
def _inner(request, domain, *args, **kwargs): couch_user = _ensure_request_couch_user(request) if ( couch_user and (allow_cc_users or couch_user.is_web_user()) and couch_user.is_member_of(domain) ): clear_login_attempts(couch_user) return fn(request, domain, *args, **kwargs) else: return HttpResponseForbidden()
def _inner(request, domain, *args, **kwargs): request.couch_user = couch_user = CouchUser.from_django_user(request.user) if ( couch_user and (allow_cc_users or couch_user.is_web_user()) and couch_user.is_member_of(domain) ): clear_login_attempts(couch_user) return fn(request, domain, *args, **kwargs) else: return HttpResponseForbidden()
def post(self, request, *args, **kwargs): self.extra_context['hide_password_feedback'] = has_custom_clean_password() if request.POST['new_password1'] == request.POST['new_password2']: try: clean_password(request.POST['new_password1']) except ValidationError as e: messages.error(request, _(e.message)) return HttpResponseRedirect(request.path_info) response = super().post(request, *args, **kwargs) uidb64 = kwargs.get('uidb64') uid = urlsafe_base64_decode(uidb64) user = User.objects.get(pk=uid) couch_user = CouchUser.from_django_user(user) clear_login_attempts(couch_user) return response