|
22 | 22 | ) |
23 | 23 | from pydantic.fields import Field |
24 | 24 | from pydantic.types import PositiveInt |
25 | | -from pydantic_settings import SettingsConfigDict |
26 | 25 | from servicelib.logging_utils_filtering import LoggerName, MessageSubstring |
27 | 26 | from settings_library.base import BaseCustomSettings |
28 | 27 | from settings_library.email import SMTPSettings |
@@ -279,21 +278,23 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings): |
279 | 278 | "Currently this is a system plugin and cannot be disabled", |
280 | 279 | ) |
281 | 280 |
|
282 | | - @model_validator(mode="after") |
| 281 | + @model_validator(mode="before") |
283 | 282 | @classmethod |
284 | | - def build_vcs_release_url_if_unset(cls, v): |
285 | | - release_url = v.SIMCORE_VCS_RELEASE_URL |
| 283 | + def build_vcs_release_url_if_unset(cls, values): |
| 284 | + release_url = values.get("SIMCORE_VCS_RELEASE_URL") |
286 | 285 |
|
287 | | - if release_url is None and (vsc_release_tag := v.SIMCORE_VCS_RELEASE_TAG): |
| 286 | + if release_url is None and ( |
| 287 | + vsc_release_tag := values.get("SIMCORE_VCS_RELEASE_TAG") |
| 288 | + ): |
288 | 289 | if vsc_release_tag == "latest": |
289 | 290 | release_url = ( |
290 | 291 | "https://github.com/ITISFoundation/osparc-simcore/commits/master/" |
291 | 292 | ) |
292 | 293 | else: |
293 | 294 | release_url = f"https://github.com/ITISFoundation/osparc-simcore/releases/tag/{vsc_release_tag}" |
294 | | - v.SIMCORE_VCS_RELEASE_URL = release_url |
| 295 | + values["SIMCORE_VCS_RELEASE_URL"] = release_url |
295 | 296 |
|
296 | | - return v |
| 297 | + return values |
297 | 298 |
|
298 | 299 | @field_validator( |
299 | 300 | # List of plugins under-development (keep up-to-date) |
|
0 commit comments