From 84933c08ccda0160db5e80a93d91bbffb535b570 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 3 Apr 2023 19:41:20 +0200 Subject: [PATCH] feat(users): don't hide user email if it was the search request --- pkg/user/users_project.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/user/users_project.go b/pkg/user/users_project.go index 71e397c32..6154629ec 100644 --- a/pkg/user/users_project.go +++ b/pkg/user/users_project.go @@ -94,7 +94,13 @@ func ListUsers(s *xorm.Session, search string, opts *ProjectUserOpts) (users []* Where(cond). Find(&users) +outer: for _, u := range users { + for _, part := range strings.Split(search, ",") { + if u.Email == part { + continue outer + } + } u.Email = "" } return