🐛 fix(validate.py): set prompt_request.name to the key of the only custom field if it is an empty string and there is only one custom field to handle the first prompt request after node creation
This commit is contained in:
parent
bd9c53bf14
commit
cc6cf4df35
1 changed files with 10 additions and 0 deletions
|
|
@ -53,6 +53,16 @@ def post_validate_prompt(prompt_request: ValidatePromptRequest):
|
|||
|
||||
def get_old_custom_fields(prompt_request):
|
||||
try:
|
||||
if (
|
||||
len(prompt_request.frontend_node.custom_fields) == 1
|
||||
and prompt_request.name == ""
|
||||
):
|
||||
# If there is only one custom field and the name is empty string
|
||||
# then we are dealing with the first prompt request after the node was created
|
||||
prompt_request.name = list(
|
||||
prompt_request.frontend_node.custom_fields.keys()
|
||||
)[0]
|
||||
|
||||
old_custom_fields = prompt_request.frontend_node.custom_fields[
|
||||
prompt_request.name
|
||||
].copy()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue