mirror of
https://github.com/jazzband/django-eav2.git
synced 2026-03-16 22:40:26 +00:00
Allow attribute_value to be None if enum type
This commit is contained in:
parent
1f629506a8
commit
def1bc5ade
1 changed files with 2 additions and 1 deletions
|
|
@ -529,7 +529,8 @@ class Entity(object):
|
|||
if self._hasattr(attribute.slug):
|
||||
attribute_value = self._getattr(attribute.slug)
|
||||
if attribute.datatype == Attribute.TYPE_ENUM and not isinstance(attribute_value, EnumValue):
|
||||
attribute_value = EnumValue.objects.get(value=attribute_value)
|
||||
if attribute_value is not None:
|
||||
attribute_value = EnumValue.objects.get(value=attribute_value)
|
||||
attribute.save_value(self.instance, attribute_value)
|
||||
|
||||
def validate_attributes(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue