|
|
|
@ -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) |
|
|
|
|
} |
|
|
|
|