From 06635898d0960235d0bb1931f595c772e2e3652b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 25 Mar 2026 17:29:57 -0500 Subject: [PATCH] refac --- backend/open_webui/constants.py | 8 ++++---- backend/open_webui/utils/logger.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/constants.py b/backend/open_webui/constants.py index ec1d0c604..c0c79fdf5 100644 --- a/backend/open_webui/constants.py +++ b/backend/open_webui/constants.py @@ -9,7 +9,7 @@ class MESSAGES(str, Enum): class WEBHOOK_MESSAGES(str, Enum): DEFAULT = lambda msg='': f'{msg if msg else ""}' - USER_SIGNUP = lambda username='': (f'New user signed up: {username}' if username else 'New user signed up') + USER_SIGNUP = lambda username='': f'New user signed up: {username}' if username else 'New user signed up' class ERROR_MESSAGES(str, Enum): @@ -80,8 +80,8 @@ class ERROR_MESSAGES(str, Enum): OLLAMA_API_DISABLED = 'The Ollama API is disabled. Please enable it to use this feature.' - FILE_TOO_LARGE = ( - lambda size='': f"Oops! The file you're trying to upload is too large. Please upload a file that is less than {size}." + FILE_TOO_LARGE = lambda size='': ( + f"Oops! The file you're trying to upload is too large. Please upload a file that is less than {size}." ) DUPLICATE_CONTENT = 'Duplicate content detected. Please provide unique content to proceed.' @@ -89,7 +89,7 @@ class ERROR_MESSAGES(str, Enum): 'Extracted content is not available for this file. Please ensure that the file is processed before proceeding.' ) - INVALID_PASSWORD = lambda err='': (err if err else 'The password does not meet the required validation criteria.') + INVALID_PASSWORD = lambda err='': err if err else 'The password does not meet the required validation criteria.' class TASKS(str, Enum): diff --git a/backend/open_webui/utils/logger.py b/backend/open_webui/utils/logger.py index 5cc34fe92..49b7973c5 100644 --- a/backend/open_webui/utils/logger.py +++ b/backend/open_webui/utils/logger.py @@ -150,7 +150,7 @@ def start_logger(): """ logger.remove() - audit_filter = lambda record: (True if ENABLE_AUDIT_STDOUT else 'auditable' not in record['extra']) + audit_filter = lambda record: True if ENABLE_AUDIT_STDOUT else 'auditable' not in record['extra'] if LOG_FORMAT == 'json': logger.add( _json_sink,