Add extra chunking information in Tenant schema

Add extra scripts for flask-migrate to support refactoring
This commit is contained in:
Josako
2024-05-08 17:40:42 +02:00
parent cd5afa0408
commit bf6d91527b
9 changed files with 173 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ def add_document():
set_logging_information(new_doc, dt.now(tz.utc))
# Create the DocumentLanguage
new_doc_lang = create_language_for_document(new_doc, form.language.data)
new_doc_lang = create_language_for_document(new_doc, form.language.data, form.user_context.data)
# Create the DocumentVersion
new_doc_vers = DocumentVersion()
@@ -122,13 +122,16 @@ def set_logging_information(obj, timestamp):
obj.updated_by = current_user.id
def create_language_for_document(document, language):
def create_language_for_document(document, language, user_context):
new_doc_lang = DocumentLanguage()
if language == '':
new_doc_lang.language = session['default_language']
else:
new_doc_lang.language = language
if user_context != '':
new_doc_lang.user_context = user_context
new_doc_lang.document = document
set_logging_information(new_doc_lang, dt.now(tz.utc))