Skip to content

Commit d529da8

Browse files
committed
Fixed bug with with missing populate_from
1 parent ca87908 commit d529da8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

localized_fields/fields/localized_uniqueslug_field.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@ class LocalizedUniqueSlugField(LocalizedAutoSlugField):
2626
def __init__(self, *args, **kwargs):
2727
"""Initializes a new instance of :see:LocalizedUniqueSlugField."""
2828

29-
self.populate_from = kwargs.pop('populate_from')
3029
kwargs['uniqueness'] = kwargs.pop('uniqueness', get_language_codes())
3130

3231
super(LocalizedUniqueSlugField, self).__init__(
3332
*args,
3433
**kwargs
3534
)
3635

37-
def pre_save(self, instance, _add: bool):
36+
self.populate_from = kwargs.pop('populate_from')
37+
38+
def pre_save(self, instance, add: bool):
3839
"""Ran just before the model is saved, allows us to built
3940
the slug.
4041

0 commit comments

Comments
 (0)