Skip to content

Commit

Permalink
fix(api): import a workflow containing an app without a repository li…
Browse files Browse the repository at this point in the history
…nked (#4085)
  • Loading branch information
fsamin authored and richardlt committed Mar 25, 2019
1 parent 315856d commit 89fe68b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/api/workflow/dao_data_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func insertNodeHookData(db gorp.SqlExecutor, w *sdk.Workflow, n *sdk.Node) error

if model.Name == sdk.RepositoryWebHookModelName || model.Name == sdk.GitPollerModelName {
if n.Context.ApplicationID == 0 || w.Applications[n.Context.ApplicationID].RepositoryFullname == "" || w.Applications[n.Context.ApplicationID].VCSServer == "" {
return sdk.WrapError(sdk.ErrForbidden, "insertNodeHookData> Cannot create a git poller or repository webhook on an application without a repository")
return sdk.NewErrorFrom(sdk.ErrForbidden, "cannot create a git poller or repository webhook on an application without a repository")
}
h.Config["vcsServer"] = sdk.WorkflowNodeHookConfigValue{
Value: w.Applications[n.Context.ApplicationID].VCSServer,
Expand Down

0 comments on commit 89fe68b

Please sign in to comment.