Merge pull request #745 from butonic/fix-id-or-username-query-handling

Fix id or username query handling
This commit is contained in:
Phil Davis
2020-10-23 21:29:49 +05:45
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -230,7 +230,7 @@ func (s Service) findAccountsByQuery(ctx context.Context, query string) ([]strin
qID, qSam := match[1], match[2]
tmp := &proto.Account{}
err = s.repo.LoadAccount(ctx, qID, tmp)
if err != nil {
if err != nil && !storage.IsNotFoundErr(err) {
return nil, err
}
searchResults, err = s.index.FindBy(&proto.Account{}, "OnPremisesSamAccountName", qSam)

View File

@@ -0,0 +1,7 @@
Bugfix: Fix id or username query handling
Tags: accounts
The code was stopping execution when encountering an error while loading an account by id. But for or queries we can continue execution.
https://github.com/owncloud/ocis/pull/745