#204: Fixed file upload return failure handling for generated apps
This commit is contained in:
@@ -382,7 +382,7 @@ class AppBase:
|
||||
for item in value:
|
||||
print("VALUE: %s" % item)
|
||||
if len(item) != 36:
|
||||
print("Bad length for value")
|
||||
print("Bad length for file value %s" % item)
|
||||
continue
|
||||
#return {
|
||||
# "filename": "",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -6407,7 +6407,7 @@ const AngularWorkflow = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Tooltip title={data.result} placement="left-start">
|
||||
<Tooltip key={data.execution_id} title={data.result} placement="left-start">
|
||||
<Paper elevation={5} key={data.execution_id} square style={executionPaperStyle} onMouseOver={() => {}} onMouseOut={() => {}} onClick={() => {
|
||||
|
||||
if (data.result === undefined || data.result === null || data.result.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user