[6486] Fix status code when adding an existing user to org (#6678)

pull/6691/head
Pavlos Daoglou 9 years ago committed by Torkel Ödegaard
parent 02dc51b1b6
commit c365d52a80
  1. 3
      pkg/api/org_users.go

@ -38,6 +38,9 @@ func addOrgUserHelper(cmd m.AddOrgUserCommand) Response {
cmd.UserId = userToAdd.Id
if err := bus.Dispatch(&cmd); err != nil {
if err == m.ErrOrgUserAlreadyAdded {
return ApiError(409, "User is already member of this organization", nil)
}
return ApiError(500, "Could not add user to organization", err)
}

Loading…
Cancel
Save