#204: Fixed file upload return failure handling for generated apps

This commit is contained in:
frikky
2021-01-21 15:15:29 +01:00
parent 2947e1d57e
commit 08f2d14319
4 changed files with 13 additions and 6 deletions
+7 -4
View File
@@ -370,11 +370,14 @@ func makePythoncode(swagger *openapi3.Swagger, name, url, method string, paramet
fileGrabber := ``
fileParameter := ``
if method == "post" && len(fileField) > 0 {
fileGrabber = `filedata = self.get_file(file_id)`
//fileGrabber += "\n print(filedata)"
fileAdder = fmt.Sprintf(`files = {"%s": (filedata["filename"], filedata["data"])}`, fileField)
fileBalance = ", files=files"
fileParameter = ", file_id"
fileGrabber = `filedata = self.get_file(file_id)`
// This indentation is confusing (but correct) ROFL
fileAdder = fmt.Sprintf(`if not filedata["success"]:
return file_id+" is not a valid File ID"
files = {"%s": (filedata["filename"], filedata["data"])}`, fileField)
fileBalance = ", files=files"
}
// Extra param for url if it's changeable
+4
View File
@@ -3278,6 +3278,10 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf
}
action.LargeImage = ""
if len(action.Label) == 0 {
action.Label = action.ID
}
log.Printf("LABEL: %s", action.Label)
newActions = append(newActions, action)
// If the node is NOT found, it's supposed to be set to SKIPPED,