From 36f6e946b097d4561fc2e5940c85982432fd40cc Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Thu, 27 Jun 2019 15:15:44 +0300 Subject: [PATCH] Attempt at reducing deprecation warning spam --- localized_fields/fields/autoslug_field.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/localized_fields/fields/autoslug_field.py b/localized_fields/fields/autoslug_field.py index 4e67bbf..e3ee261 100644 --- a/localized_fields/fields/autoslug_field.py +++ b/localized_fields/fields/autoslug_field.py @@ -17,17 +17,17 @@ class LocalizedAutoSlugField(LocalizedField): """Automatically provides slugs for a localized field upon saving.""" + warnings.warn( + 'LocalizedAutoSlug is deprecated and will be removed in the next major version.', + DeprecationWarning + ) + def __init__(self, *args, **kwargs): """Initializes a new instance of :see:LocalizedAutoSlugField.""" self.populate_from = kwargs.pop('populate_from', None) self.include_time = kwargs.pop('include_time', False) - warnings.warn( - 'LocalizedAutoSlug is deprecated and will be removed in the next major version.', - DeprecationWarning - ) - super(LocalizedAutoSlugField, self).__init__( *args, **kwargs