- Refinenement of improved RAG_SPECIALIST
- Changed label of RetrieverType in Retriever form
This commit is contained in:
@@ -140,21 +140,17 @@ def enforce_tenant_consent_ui():
|
||||
"""Check if the user has consented to the terms of service"""
|
||||
path = getattr(request, 'path', '') or ''
|
||||
if path.startswith('/healthz') or path.startswith('/_healthz'):
|
||||
current_app.logger.debug(f'Health check request, bypassing consent guard: {path}')
|
||||
return None
|
||||
|
||||
if not current_user.is_authenticated:
|
||||
current_app.logger.debug('Not authenticated, bypassing consent guard')
|
||||
return None
|
||||
|
||||
endpoint = request.endpoint or ''
|
||||
if is_exempt_endpoint(endpoint) or request.method == 'OPTIONS':
|
||||
current_app.logger.debug(f'Endpoint exempt from consent guard: {endpoint}')
|
||||
return None
|
||||
|
||||
# Global bypass: Super User and Partner Admin always allowed
|
||||
if current_user.has_roles('Super User') or current_user.has_roles('Partner Admin'):
|
||||
current_app.logger.debug('Global bypass: Super User or Partner Admin')
|
||||
return None
|
||||
|
||||
tenant_id = getattr(current_user, 'tenant_id', None)
|
||||
@@ -176,16 +172,13 @@ def enforce_tenant_consent_ui():
|
||||
status = ConsentStatus.NOT_CONSENTED
|
||||
|
||||
if status == ConsentStatus.CONSENTED:
|
||||
current_app.logger.debug('User has consented')
|
||||
return None
|
||||
|
||||
if status == ConsentStatus.NOT_CONSENTED:
|
||||
current_app.logger.debug('User has not consented')
|
||||
if current_user.has_roles('Tenant Admin'):
|
||||
return redirect(prefixed_url_for('user_bp.tenant_consent', for_redirect=True))
|
||||
return redirect(prefixed_url_for('user_bp.no_consent', for_redirect=True))
|
||||
if status == ConsentStatus.RENEWAL_REQUIRED:
|
||||
current_app.logger.debug('Consent renewal required')
|
||||
if current_user.has_roles('Tenant Admin'):
|
||||
flash(
|
||||
"You need to renew your consent to our DPA or T&Cs. Failing to do so in time will stop you from accessing our services.",
|
||||
|
||||
Reference in New Issue
Block a user