Don't return all tasks when a user has no lists

This commit is contained in:
kolaente 2020-05-19 17:22:10 +02:00
parent 91a3b7aba2
commit 24aa68f090
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -163,6 +163,11 @@ func (t *Task) ReadAll(a web.Auth, search string, page int, perPage int) (result
func getRawTasksForLists(lists []*List, opts *taskOptions) (tasks []*Task, resultCount int, totalItems int64, err error) { func getRawTasksForLists(lists []*List, opts *taskOptions) (tasks []*Task, resultCount int, totalItems int64, err error) {
// If the user does not have any lists, don't try to get any tasks
if len(lists) == 0 {
return nil, 0, 0, nil
}
// Set the default concatinator of filter variables to or if none was provided // Set the default concatinator of filter variables to or if none was provided
if opts.filterConcat == "" { if opts.filterConcat == "" {
opts.filterConcat = filterConcatOr opts.filterConcat = filterConcatOr