- Remove welcome message from tenant make customisation

- Add possibility to add allowed_languages to tenant make
This commit is contained in:
Josako
2025-06-26 15:52:10 +02:00
parent fda267b479
commit 53e32a67bd
5 changed files with 78 additions and 5 deletions

View File

@@ -655,6 +655,8 @@ def tenant_make():
new_tenant_make.tenant_id = tenant_id
customisation_options = form.get_dynamic_data("configuration")
new_tenant_make.chat_customisation_options = json.dumps(customisation_options)
# Verwerk allowed_languages als array
new_tenant_make.allowed_languages = form.allowed_languages.data if form.allowed_languages.data else None
set_logging_information(new_tenant_make, dt.now(tz.utc))
try:
@@ -703,6 +705,10 @@ def edit_tenant_make(tenant_make_id):
# Create form instance with the tenant make
form = EditTenantMakeForm(request.form, obj=tenant_make)
# Initialiseer de allowed_languages selectie met huidige waarden
if tenant_make.allowed_languages:
form.allowed_languages.data = tenant_make.allowed_languages
customisation_config = cache_manager.customisations_config_cache.get_config("CHAT_CLIENT_CUSTOMISATION")
form.add_dynamic_fields("configuration", customisation_config, tenant_make.chat_customisation_options)
@@ -710,6 +716,8 @@ def edit_tenant_make(tenant_make_id):
# Update basic fields
form.populate_obj(tenant_make)
tenant_make.chat_customisation_options = form.get_dynamic_data("configuration")
# Verwerk allowed_languages als array
tenant_make.allowed_languages = form.allowed_languages.data if form.allowed_languages.data else None
# Update logging information
update_logging_information(tenant_make, dt.now(tz.utc))