Closes #22419: Replace DeprecationWarning with FutureWarning for user-facing deprecations (#22510)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
bctiemann 2026-06-24 10:14:59 -04:00 committed by GitHub
parent f25a1c7474
commit 7b1e1a1dab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 11 deletions

View File

@ -230,7 +230,7 @@ def __getattr__(name):
warnings.warn(
"OptionalLimitOffsetPagination has been renamed to NetBoxPagination. "
"OptionalLimitOffsetPagination will be removed in NetBox v4.7.0.",
DeprecationWarning,
FutureWarning,
)
return NetBoxPagination
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

View File

@ -61,7 +61,7 @@ def __getattr__(name):
warnings.warn(
f"{name} is deprecated and will be removed in NetBox v4.7. "
"Define action permissions via ObjectAction subclasses instead.",
DeprecationWarning,
FutureWarning,
stacklevel=2,
)
return _DEFAULT_ACTION_PERMISSIONS

View File

@ -15,7 +15,7 @@ class Registry(dict):
warnings.warn(
'The "models" registry key is deprecated and will be removed in NetBox v4.7. Registered models can be '
'obtained by calling ObjectType.objects.public().',
DeprecationWarning,
FutureWarning,
stacklevel=2,
)
try:

View File

@ -263,13 +263,13 @@ if not LOGIN_REQUIRED:
warnings.warn(
"LOGIN_REQUIRED is deprecated and will be removed in NetBox v5.0. Unauthenticated access to the application "
"will no longer be supported. Please plan to require authentication for all users before upgrading.",
DeprecationWarning,
FutureWarning,
)
elif hasattr(configuration, 'LOGIN_REQUIRED'):
warnings.warn(
"LOGIN_REQUIRED is deprecated and will be removed in NetBox v5.0. This parameter can be removed from your "
"configuration file.",
DeprecationWarning,
FutureWarning,
)
@ -300,13 +300,13 @@ if STORAGE_BACKEND is not None:
else:
warnings.warn(
"STORAGE_BACKEND is deprecated, use the new STORAGES setting instead.",
DeprecationWarning,
FutureWarning,
)
if STORAGE_CONFIG is not None:
warnings.warn(
"STORAGE_CONFIG is deprecated, use the new STORAGES setting instead.",
DeprecationWarning,
FutureWarning,
)
# Default STORAGES for Django
@ -657,7 +657,7 @@ for config_param in ('SENTRY_DSN', 'SENTRY_SAMPLE_RATE', 'SENTRY_SEND_DEFAULT_PI
if hasattr(configuration, config_param):
warnings.warn(
f"{config_param} is deprecated and will be removed in NetBox v4.7. Use SENTRY_CONFIG instead.",
DeprecationWarning,
FutureWarning,
)
if SENTRY_ENABLED:

View File

@ -45,7 +45,7 @@ class ActionsMixin:
warnings.warn(
f"{self.__class__.__name__}.actions is defined as a dictionary, which is deprecated and will be removed "
"in NetBox v4.7. Define actions as a list of ObjectAction subclasses instead.",
DeprecationWarning,
FutureWarning,
stacklevel=2,
)

View File

@ -79,7 +79,7 @@ def __getattr__(name):
warnings.warn(
"ExpandableIPAddressField has been renamed to ExpandableIPNetworkField. "
"ExpandableIPAddressField will be removed in NetBox v4.7.0.",
DeprecationWarning,
FutureWarning,
)
return ExpandableIPNetworkField
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

View File

@ -303,7 +303,7 @@ def __getattr__(name):
warnings.warn(
"expand_ipaddress_pattern() has been renamed to expand_ipnetwork_pattern(). "
"expand_ipaddress_pattern() will be removed in NetBox v4.7.0.",
DeprecationWarning,
FutureWarning,
)
return expand_ipnetwork_pattern
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")