mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-06-27 13:53:19 +03:00
Pop kwargs after calling super constructor
This commit is contained in:
parent
ad2ef34546
commit
679dcafef6
@ -30,14 +30,13 @@ class LocalizedUniqueSlugField(LocalizedAutoSlugField):
|
|||||||
|
|
||||||
kwargs['uniqueness'] = kwargs.pop('uniqueness', get_language_codes())
|
kwargs['uniqueness'] = kwargs.pop('uniqueness', get_language_codes())
|
||||||
|
|
||||||
self.include_time = kwargs.pop('include_time', False)
|
|
||||||
|
|
||||||
super(LocalizedUniqueSlugField, self).__init__(
|
super(LocalizedUniqueSlugField, self).__init__(
|
||||||
*args,
|
*args,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
self.populate_from = kwargs.pop('populate_from')
|
self.populate_from = kwargs.pop('populate_from')
|
||||||
|
self.include_time = kwargs.pop('include_time', False)
|
||||||
|
|
||||||
def deconstruct(self):
|
def deconstruct(self):
|
||||||
"""Deconstructs the field into something the database
|
"""Deconstructs the field into something the database
|
||||||
@ -48,6 +47,8 @@ class LocalizedUniqueSlugField(LocalizedAutoSlugField):
|
|||||||
|
|
||||||
kwargs['populate_from'] = self.populate_from
|
kwargs['populate_from'] = self.populate_from
|
||||||
kwargs['include_time'] = self.include_time
|
kwargs['include_time'] = self.include_time
|
||||||
|
# if not kwargs['include_time']:
|
||||||
|
# raise RuntimeError()
|
||||||
return name, path, args, kwargs
|
return name, path, args, kwargs
|
||||||
|
|
||||||
def pre_save(self, instance, add: bool):
|
def pre_save(self, instance, add: bool):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user