mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 03:32:55 +03:00
Fixed bug with with missing populate_from
This commit is contained in:
parent
ca879087ea
commit
d529da8886
@ -26,7 +26,6 @@ class LocalizedUniqueSlugField(LocalizedAutoSlugField):
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Initializes a new instance of :see:LocalizedUniqueSlugField."""
|
||||
|
||||
self.populate_from = kwargs.pop('populate_from')
|
||||
kwargs['uniqueness'] = kwargs.pop('uniqueness', get_language_codes())
|
||||
|
||||
super(LocalizedUniqueSlugField, self).__init__(
|
||||
@ -34,7 +33,9 @@ class LocalizedUniqueSlugField(LocalizedAutoSlugField):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
def pre_save(self, instance, _add: bool):
|
||||
self.populate_from = kwargs.pop('populate_from')
|
||||
|
||||
def pre_save(self, instance, add: bool):
|
||||
"""Ran just before the model is saved, allows us to built
|
||||
the slug.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user