mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 11:42:54 +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):
|
def __init__(self, *args, **kwargs):
|
||||||
"""Initializes a new instance of :see:LocalizedUniqueSlugField."""
|
"""Initializes a new instance of :see:LocalizedUniqueSlugField."""
|
||||||
|
|
||||||
self.populate_from = kwargs.pop('populate_from')
|
|
||||||
kwargs['uniqueness'] = kwargs.pop('uniqueness', get_language_codes())
|
kwargs['uniqueness'] = kwargs.pop('uniqueness', get_language_codes())
|
||||||
|
|
||||||
super(LocalizedUniqueSlugField, self).__init__(
|
super(LocalizedUniqueSlugField, self).__init__(
|
||||||
@ -34,7 +33,9 @@ class LocalizedUniqueSlugField(LocalizedAutoSlugField):
|
|||||||
**kwargs
|
**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
|
"""Ran just before the model is saved, allows us to built
|
||||||
the slug.
|
the slug.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user