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

This commit is contained in:
Pavlos Daoglou authored and Torkel Ödegaard committed 2016-11-23 14:38:44 +01:00
1 parent 02dc51b1b6
commit c365d52a80
1 file changed
+3
+3
View File
@@ -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)
}