Skip to content

Commit

Permalink
IsValid fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Nov 30, 2024
1 parent 8af7416 commit a411cb7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -7512,8 +7512,8 @@ func SaveWorkflow(resp http.ResponseWriter, request *http.Request) {
}

if !handled {
action.IsValid = false
action.Errors = []string{fmt.Sprintf("Couldn't find app %s:%s", action.AppName, action.AppVersion)}
action.IsValid = false
}
}
}
Expand Down Expand Up @@ -8009,7 +8009,7 @@ func SaveWorkflow(resp http.ResponseWriter, request *http.Request) {
if !authFound {
log.Printf("[WARNING] App auth %s doesn't exist. Setting error", action.AuthenticationId)

errorMsg := fmt.Sprintf("Selected app Authentication for app %s doesn't exist!", strings.ToLower(strings.ReplaceAll(action.AppName, "_", " ")))
errorMsg := fmt.Sprintf("Authentication for action '%s' in app '%s' doesn't exist!", action.Label, strings.ToLower(strings.ReplaceAll(action.AppName, "_", " ")))
if !ArrayContains(workflow.Errors, errorMsg) {
workflow.Errors = append(workflow.Errors, errorMsg)
}
Expand Down Expand Up @@ -8186,14 +8186,14 @@ func SaveWorkflow(resp http.ResponseWriter, request *http.Request) {

if authRequired && fieldsFilled > 1 {
foundErr := fmt.Sprintf("Action %s (%s) requires authentication", action.Label, strings.ToLower(strings.Replace(action.AppName, "_", " ", -1)))

if !ArrayContains(workflow.Errors, foundErr) {
log.Printf("\n\n[DEBUG] Adding auth error 1: %s\n\n", foundErr)
workflow.Errors = append(workflow.Errors, foundErr)
}

if !ArrayContains(action.Errors, foundErr) {
action.Errors = append(action.Errors, foundErr)
action.IsValid = false
}
} else if authRequired && fieldsFilled == 1 {
foundErr := fmt.Sprintf("Action %s (%s) requires authentication", action.Label, strings.ToLower(strings.Replace(action.AppName, "_", " ", -1)))
Expand All @@ -8206,6 +8206,7 @@ func SaveWorkflow(resp http.ResponseWriter, request *http.Request) {

if !ArrayContains(action.Errors, foundErr) {
action.Errors = append(action.Errors, foundErr)
action.IsValid = false
}
}
}
Expand Down Expand Up @@ -8279,6 +8280,7 @@ func SaveWorkflow(resp http.ResponseWriter, request *http.Request) {

if !ArrayContains(action.Errors, thisError) {
action.Errors = append(action.Errors, thisError)
action.IsValid = false
}

// Updates an existing version of the same one for each missing param
Expand Down Expand Up @@ -28892,8 +28894,6 @@ func HandleExecutionCacheIncrement(ctx context.Context, execution WorkflowExecut
}
}

// FIXME: Always fails:

func GetChildWorkflows(resp http.ResponseWriter, request *http.Request) {
cors := HandleCors(resp, request)
if cors {
Expand Down

0 comments on commit a411cb7

Please sign in to comment.