Set RemovedInOscar15Warning for existing deprecation warnings
@@ -8,6 +8,8 @@ else:
CHECK_TYPES = (type, ClassType)
import warnings
+from oscar.utils.deprecation import RemovedInOscar15Warning
+
def deprecated(obj):
if isinstance(obj, CHECK_TYPES):
@@ -18,10 +20,11 @@ def deprecated(obj):
def _deprecated_func(f):
def _deprecated(*args, **kwargs):
- message = "Method '%s' is deprecated and will be " \
- "removed in the next major version of django-oscar" \
- % f.__name__
- warnings.warn(message, DeprecationWarning, stacklevel=2)
+ message = (
+ "Method '%s' is deprecated and will be " +
+ "removed in Oscar 1.5"
+ ) % (f.__name__)
+ warnings.warn(message, RemovedInOscar15Warning, stacklevel=2)
return f(*args, **kwargs)
return _deprecated
@@ -29,9 +32,10 @@ def _deprecated_func(f):
def _deprecated_cls(cls):
class Deprecated(cls):
def __init__(self, *args, **kwargs):
- message = "Class '%s' is deprecated and will be " \
- "removed in the next major version of django-oscar" \
- % cls.__name__
- warnings.warn(message, DeprecationWarning, stacklevel=2)
+ message = (
+ "Class '%s' is deprecated and will be " +
+ "removed in Oscar 1.5"
+ ) % (cls.__name__)
+ warnings.warn(message, RemovedInOscar15Warning, stacklevel=2)
super(Deprecated, self).__init__(*args, **kwargs)
return Deprecated
