Skip to content

Commit

Permalink
Fix author filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
mraron committed Jun 23, 2024
1 parent 5c504a7 commit 9ac2403
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/njudge/memory/problemlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ func (p *ProblemListQuery) filterInvisible(ctx context.Context, req njudge.Probl

func (p *ProblemListQuery) filterAuthor(ctx context.Context, req njudge.ProblemListRequest, pr njudge.Problem) (bool, error) {
if req.AuthorFilter != nil {
if *req.AuthorFilter == "" { // special case, empty filter should filter empty author fields
return pr.Author == "", nil
}
return strings.Contains(pr.Author, *req.AuthorFilter), nil
}
return true, nil
Expand Down

0 comments on commit 9ac2403

Please sign in to comment.