diff --git a/netbox/netbox/api/pagination.py b/netbox/netbox/api/pagination.py index bbdc83256..d6ddb4d39 100644 --- a/netbox/netbox/api/pagination.py +++ b/netbox/netbox/api/pagination.py @@ -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}") diff --git a/netbox/netbox/constants.py b/netbox/netbox/constants.py index efe42c383..037059583 100644 --- a/netbox/netbox/constants.py +++ b/netbox/netbox/constants.py @@ -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 diff --git a/netbox/netbox/registry.py b/netbox/netbox/registry.py index 151029ca1..42601d6e9 100644 --- a/netbox/netbox/registry.py +++ b/netbox/netbox/registry.py @@ -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: diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index cd5fb2e4e..e2e12132a 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -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: diff --git a/netbox/netbox/views/generic/mixins.py b/netbox/netbox/views/generic/mixins.py index 2945e0e33..46e4624fa 100644 --- a/netbox/netbox/views/generic/mixins.py +++ b/netbox/netbox/views/generic/mixins.py @@ -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, ) diff --git a/netbox/utilities/forms/fields/expandable.py b/netbox/utilities/forms/fields/expandable.py index ea222268e..0a4102377 100644 --- a/netbox/utilities/forms/fields/expandable.py +++ b/netbox/utilities/forms/fields/expandable.py @@ -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}") diff --git a/netbox/utilities/forms/utils.py b/netbox/utilities/forms/utils.py index b40ffa77c..2948fbcb6 100644 --- a/netbox/utilities/forms/utils.py +++ b/netbox/utilities/forms/utils.py @@ -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}")