🐛 fix(validate.py): change dict() to to_dict() method to fix TypeError

The `dict()` method was causing a TypeError when trying to serialize the `template_field` object. The `to_dict()` method is the correct method to use to serialize the object.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-27 19:49:30 -03:00
commit 753eae28c7

View file

@ -37,7 +37,7 @@ def post_validate_prompt(prompt: ValidatePromptRequest):
name=variable, field_type="str", show=True, advanced=False
)
prompt.frontend_node.template[variable] = template_field.dict()
prompt.frontend_node.template[variable] = template_field.to_dict()
prompt.frontend_node.custom_fields.append(variable)
except Exception as exc:
logger.exception(exc)