def two_factor_auth_enabled(user): return config.ENABLE_TWO_FACTOR_AUTH and user_has_device(user)
def get(self, request, *args, **kwargs): if not user_has_device(self.request.user): return HttpResponseRedirect(reverse('edit_profile')) return super(DisableView, self).get(request, *args, **kwargs)
def test(user): return user.is_verified() or (if_configured and user.is_authenticated() and not user_has_device(user))
def test(user): return user.is_verified() or (if_configured and user.is_authenticated and not user_has_device(user))