mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2025-09-10 17:20:41 +03:00
parent
47c7524cf8
commit
482e1fdda1
@ -64,6 +64,7 @@ class AppSettings(SentrySettings, BaseSettings):
|
||||
|
||||
@model_validator(mode="before") # type: ignore[arg-type]
|
||||
def validate_boolean_fields(self) -> Any:
|
||||
values_dict: dict[str, Any] = self # type: ignore[assignment]
|
||||
for value in (
|
||||
"ENABLE_JSON_LOGS",
|
||||
"ENABLE_SENTRY_LOGS",
|
||||
@ -71,9 +72,10 @@ class AppSettings(SentrySettings, BaseSettings):
|
||||
"RELOAD",
|
||||
"DEBUG",
|
||||
):
|
||||
if self.get(value).lower() == "false": # type: ignore[attr-defined]
|
||||
self[value] = False # type: ignore[index]
|
||||
return self
|
||||
setting_value: str | None = values_dict.get(value)
|
||||
if setting_value and setting_value.lower() == "false":
|
||||
values_dict[value] = False
|
||||
return values_dict
|
||||
|
||||
@cached_property
|
||||
def api_prefix(self) -> str:
|
||||
|
Loading…
x
Reference in New Issue
Block a user