mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Return 404 on user not found (#15606)
Return 404 on user not found closes #10506
This commit is contained in:
parent
1e719bb3db
commit
41024c29bb
@ -27,6 +27,10 @@ func GetPendingOrgInvites(c *m.ReqContext) Response {
|
||||
}
|
||||
|
||||
func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response {
|
||||
if setting.DisableLoginForm {
|
||||
return Error(400, "Cannot invite when login is disabled.", nil)
|
||||
}
|
||||
|
||||
if !inviteDto.Role.IsValid() {
|
||||
return Error(400, "Invalid role specified", nil)
|
||||
}
|
||||
@ -37,10 +41,6 @@ func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response {
|
||||
if err != m.ErrUserNotFound {
|
||||
return Error(500, "Failed to query db for existing user check", err)
|
||||
}
|
||||
|
||||
if setting.DisableLoginForm {
|
||||
return Error(401, "User could not be found", nil)
|
||||
}
|
||||
} else {
|
||||
return inviteExistingUserToOrg(c, userQuery.Result, &inviteDto)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user