mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-06-27 13:53:19 +03:00
fixed for new instance don't call refresh_from_db
This commit is contained in:
parent
f0c7a72078
commit
78594541e1
@ -43,9 +43,11 @@ class LocalizedValueDescriptor(object):
|
||||
# in __set__.
|
||||
if self.field.name in instance.__dict__:
|
||||
value = instance.__dict__[self.field.name]
|
||||
else:
|
||||
elif instance.pk is not None:
|
||||
instance.refresh_from_db(fields=[self.field.name])
|
||||
value = getattr(instance, self.field.name)
|
||||
else:
|
||||
value = None
|
||||
|
||||
if value is None:
|
||||
attr = self.field.attr_class()
|
||||
|
Loading…
x
Reference in New Issue
Block a user