Skip to content

Commit cc911d4

Browse files
committed
LocalizedAutoSlugField should only warn about deprecation if used
1 parent 0f30cc1 commit cc911d4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

localized_fields/fields/autoslug_field.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
class LocalizedAutoSlugField(LocalizedField):
1717
"""Automatically provides slugs for a localized field upon saving."""
1818

19-
warnings.warn(
20-
"LocalizedAutoSlug is deprecated and will be removed in the next major version.",
21-
DeprecationWarning,
22-
)
23-
2419
def __init__(self, *args, **kwargs):
2520
"""Initializes a new instance of :see:LocalizedAutoSlugField."""
2621

22+
warnings.warn(
23+
"LocalizedAutoSlug is deprecated and will be removed in the next major version.",
24+
DeprecationWarning,
25+
)
26+
2727
self.populate_from = kwargs.pop("populate_from", None)
2828
self.include_time = kwargs.pop("include_time", False)
2929

0 commit comments

Comments
 (0)