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