- Bugfixing
This commit is contained in:
@@ -20,10 +20,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- For now removed features.
|
- For now removed features.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- For any bug fixes.
|
- Set default language when registering Documents or URLs.
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
- In case of vulnerabilities.
|
- In case of vulnerabilities.
|
||||||
|
-
|
||||||
|
## [1.0.6-alfa] - 2024-09-03
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Problems with tenant scheme migrations - may have to be revisited
|
||||||
|
- Correction of default language settings when uploading docs or URLs
|
||||||
|
- Addition of a CHANGELOG.md file
|
||||||
|
|
||||||
## [1.0.5-alfa] - 2024-09-02
|
## [1.0.5-alfa] - 2024-09-02
|
||||||
|
|
||||||
|
|||||||
2
common/models/README.txt
Normal file
2
common/models/README.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
If models are added to the public schema (i.e. in the user domain), ensure to add their corresponding tables to the
|
||||||
|
env.py, get_public_table_names, for tenant migrations!
|
||||||
@@ -5,6 +5,7 @@ from common.models.document import Document, DocumentVersion
|
|||||||
from common.extensions import db, minio_client
|
from common.extensions import db, minio_client
|
||||||
from common.utils.celery_utils import current_celery
|
from common.utils.celery_utils import current_celery
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
|
from flask_security import current_user
|
||||||
import requests
|
import requests
|
||||||
from urllib.parse import urlparse, unquote
|
from urllib.parse import urlparse, unquote
|
||||||
import os
|
import os
|
||||||
@@ -109,10 +110,30 @@ def set_logging_information(obj, timestamp):
|
|||||||
obj.created_at = timestamp
|
obj.created_at = timestamp
|
||||||
obj.updated_at = timestamp
|
obj.updated_at = timestamp
|
||||||
|
|
||||||
|
user_id = get_current_user_id()
|
||||||
|
if user_id:
|
||||||
|
obj.created_by = user_id
|
||||||
|
obj.updated_by = user_id
|
||||||
|
|
||||||
|
|
||||||
def update_logging_information(obj, timestamp):
|
def update_logging_information(obj, timestamp):
|
||||||
obj.updated_at = timestamp
|
obj.updated_at = timestamp
|
||||||
|
|
||||||
|
user_id = get_current_user_id()
|
||||||
|
if user_id:
|
||||||
|
obj.updated_by = user_id
|
||||||
|
|
||||||
|
|
||||||
|
def get_current_user_id():
|
||||||
|
try:
|
||||||
|
if current_user and current_user.is_authenticated:
|
||||||
|
return current_user.id
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
except Exception:
|
||||||
|
# This will catch any errors if current_user is not available (e.g., in API context)
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_extension_from_content_type(content_type):
|
def get_extension_from_content_type(content_type):
|
||||||
content_type_map = {
|
content_type_map = {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Chunking Settings Tab -->
|
<!-- Chunking Settings Tab -->
|
||||||
<div class="tab-pane fade" id="chunking-tab" role="tabpanel">
|
<div class="tab-pane fade" id="chunking-tab" role="tabpanel">
|
||||||
{% set html_fields = ['html_tags', 'html_end_tags', 'html_included_elements', 'html_excluded_elements', 'min_chunk_size', 'max_chunk_size'] %}
|
{% set html_fields = ['html_tags', 'html_end_tags', 'html_included_elements', 'html_excluded_elements', 'html_excluded_classes', 'min_chunk_size', 'max_chunk_size'] %}
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
{{ render_included_field(field, disabled_fields=html_fields, include_fields=html_fields) }}
|
{{ render_included_field(field, disabled_fields=html_fields, include_fields=html_fields) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -265,8 +265,8 @@ def edit_document_version(document_version_id):
|
|||||||
@document_bp.route('/document_versions/<int:document_id>', methods=['GET', 'POST'])
|
@document_bp.route('/document_versions/<int:document_id>', methods=['GET', 'POST'])
|
||||||
@roles_accepted('Super User', 'Tenant Admin')
|
@roles_accepted('Super User', 'Tenant Admin')
|
||||||
def document_versions(document_id):
|
def document_versions(document_id):
|
||||||
doc_vers = DocumentVersion.query.get_or_404(document_id)
|
doc = Document.query.get_or_404(document_id)
|
||||||
doc_desc = f'Document {doc_vers.document.name}, Language {doc_vers.language}'
|
doc_desc = f'Document {doc.name}'
|
||||||
|
|
||||||
page = request.args.get('page', 1, type=int)
|
page = request.args.get('page', 1, type=int)
|
||||||
per_page = request.args.get('per_page', 10, type=int)
|
per_page = request.args.get('per_page', 10, type=int)
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ class HTMLProcessor(Processor):
|
|||||||
|
|
||||||
def _parse_excluded_classes(self, excluded_classes):
|
def _parse_excluded_classes(self, excluded_classes):
|
||||||
parsed = {}
|
parsed = {}
|
||||||
|
if excluded_classes:
|
||||||
for rule in excluded_classes:
|
for rule in excluded_classes:
|
||||||
element, cls = rule.split('.', 1)
|
element, cls = rule.split('.', 1)
|
||||||
parsed.setdefault(element, set()).add(cls)
|
parsed.setdefault(element, set()).add(cls)
|
||||||
|
|||||||
Reference in New Issue
Block a user