(self)
| 88 | |
| 89 | @model_validator(mode="after") |
| 90 | def _enforce_non_default_secrets(self) -> Self: |
| 91 | self._check_default_secret("SECRET_KEY", self.SECRET_KEY) |
| 92 | self._check_default_secret("POSTGRES_PASSWORD", self.POSTGRES_PASSWORD) |
| 93 | self._check_default_secret( |
| 94 | "FIRST_SUPERUSER_PASSWORD", self.FIRST_SUPERUSER_PASSWORD |
| 95 | ) |
| 96 | |
| 97 | if self.AI_MAX_USAGE_QUOTA is None or self.AI_MAX_USAGE_QUOTA <= 0: |
| 98 | raise ValueError("AI_MAX_USAGE_QUOTA must be set to a positive integer.") |
| 99 | if self.AI_QUOTA_TIME_RANGE_DAYS is None or self.AI_QUOTA_TIME_RANGE_DAYS <= 0: |
| 100 | raise ValueError( |
| 101 | "AI_QUOTA_TIME_RANGE_DAYS must be set to a positive integer." |
| 102 | ) |
| 103 | |
| 104 | return self |
| 105 | |
| 106 | |
| 107 | settings = Settings() # type: ignore |
nothing calls this directly
no test coverage detected