mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: although unfortunate, it is possible for a user to be in no orgs (#13956)
This commit is contained in:
@ -1293,9 +1293,12 @@ func userOrganizationIDs(ctx context.Context, api *API, user database.User) ([]u
|
||||
if err != nil {
|
||||
return []uuid.UUID{}, err
|
||||
}
|
||||
|
||||
// If you are in no orgs, then return an empty list.
|
||||
if len(organizationIDsByMemberIDsRows) == 0 {
|
||||
return []uuid.UUID{}, xerrors.Errorf("user %q must be a member of at least one organization", user.Email)
|
||||
return []uuid.UUID{}, nil
|
||||
}
|
||||
|
||||
member := organizationIDsByMemberIDsRows[0]
|
||||
return member.OrganizationIDs, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user