mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[6486] Fix status code when adding an existing user to org (#6678)
This commit is contained in:
parent
02dc51b1b6
commit
c365d52a80
@ -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…
Reference in New Issue
Block a user