diff --git a/pydantic/_migration.py b/pydantic/_migration.py index 5cc55363f72..672c9d1620d 100644 --- a/pydantic/_migration.py +++ b/pydantic/_migration.py @@ -288,7 +288,7 @@ def wrapper(name: str) -> object: if import_path == 'pydantic:BaseSettings': raise PydanticImportError( '`BaseSettings` has been moved to the `pydantic-settings` package. ' - f'See https://docs.pydantic.dev/latest/migration/#basesettings-has-moved-to-pydantic-settings ' + f'See https://docs.pydantic.dev/{".".join(VERSION.split(".")[:2])}/migration/#basesettings-has-moved-to-pydantic-settings ' 'for more details.' ) if import_path in REMOVED_IN_V2: