From 6de314b5d497ca9ce4a651109903cd596d8a78fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 23 Oct 2020 12:08:10 +0200 Subject: [PATCH] Fix id or username query handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- accounts/pkg/service/v0/accounts.go | 2 +- changelog/unreleased/fix-id-or-username-query-handling.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-id-or-username-query-handling.md diff --git a/accounts/pkg/service/v0/accounts.go b/accounts/pkg/service/v0/accounts.go index 4b933778084..bb3dfb4f145 100644 --- a/accounts/pkg/service/v0/accounts.go +++ b/accounts/pkg/service/v0/accounts.go @@ -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) diff --git a/changelog/unreleased/fix-id-or-username-query-handling.md b/changelog/unreleased/fix-id-or-username-query-handling.md new file mode 100644 index 00000000000..404ac96055e --- /dev/null +++ b/changelog/unreleased/fix-id-or-username-query-handling.md @@ -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 \ No newline at end of file