fix: add @property decorator to pydantic computed_field for compatibility (#23728)

This commit is contained in:
-LAN-
2025-08-11 15:34:19 +08:00
committed by GitHub
parent d30f898274
commit aaf9fc1562

View File

@@ -144,7 +144,8 @@ class DatabaseConfig(BaseSettings):
default="postgresql", default="postgresql",
) )
@computed_field @computed_field # type: ignore[misc]
@property
def SQLALCHEMY_DATABASE_URI(self) -> str: def SQLALCHEMY_DATABASE_URI(self) -> str:
db_extras = ( db_extras = (
f"{self.DB_EXTRAS}&client_encoding={self.DB_CHARSET}" if self.DB_CHARSET else self.DB_EXTRAS f"{self.DB_EXTRAS}&client_encoding={self.DB_CHARSET}" if self.DB_CHARSET else self.DB_EXTRAS