- Correction in the tenant_list_view to only show 'partner tenants' in case the user is a partner admin.

- Edit Partner can only be executed by Super User
- Give a more precise error message when a 403 client error is returned trying to get a URL.
This commit is contained in:
Josako
2025-07-22 15:44:39 +02:00
parent a0f806ba4e
commit dc6cd9d940
5 changed files with 97 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ from sqlalchemy.orm import aliased
from werkzeug.utils import secure_filename
from sqlalchemy.exc import SQLAlchemyError
import requests
from requests.exceptions import SSLError
from requests.exceptions import SSLError, HTTPError
import json
from common.models.document import Document, DocumentVersion, Catalog, Retriever, Processor
@@ -416,7 +416,7 @@ def add_url():
catalog = Catalog.query.get_or_404(catalog_id)
if catalog.configuration and len(catalog.configuration) > 0:
form.add_dynamic_fields("tagging_fields", catalog.configuration)
url=""
if form.validate_on_submit():
try:
tenant_id = session['tenant']['id']
@@ -456,6 +456,9 @@ def add_url():
except EveAIException as e:
current_app.logger.error(f"Error adding document: {str(e)}")
flash(str(e), 'danger')
except HTTPError as e:
current_app.logger.error(f"Server refused download for {url}: {str(e)}")
flash(f'Server refused download for {url}: {str(e)}', 'danger')
except Exception as e:
current_app.logger.error(f'Error adding document: {str(e)}')
flash('An error occurred while adding the document.', 'danger')