Fix: unable to assign null select custom fields

This commit is contained in:
shamoon
2024-07-09 11:27:30 -07:00
parent 186f520819
commit 6dc094f760
2 changed files with 70 additions and 67 deletions

View File

@@ -915,7 +915,10 @@ class CustomFieldInstance(models.Model):
def __str__(self) -> str:
value = (
self.field.extra_data["select_options"][self.value_select]
if self.field.data_type == CustomField.FieldDataType.SELECT
if (
self.field.data_type == CustomField.FieldDataType.SELECT
and self.value_select is not None
)
else self.value
)
return str(self.field.name) + f" : {value}"