mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Fix: Actor is required to get user repositories (#20443)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
0a97480934
commit
3df33799c1
3 changed files with 25 additions and 0 deletions
|
@ -6,6 +6,7 @@ package repo
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
@ -695,6 +696,9 @@ func GetUserRepositories(opts *SearchRepoOptions) (RepositoryList, int64, error)
|
|||
}
|
||||
|
||||
cond := builder.NewCond()
|
||||
if opts.Actor == nil {
|
||||
return nil, 0, errors.New("GetUserRepositories: Actor is needed but not given")
|
||||
}
|
||||
cond = cond.And(builder.Eq{"owner_id": opts.Actor.ID})
|
||||
if !opts.Private {
|
||||
cond = cond.And(builder.Eq{"is_private": false})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue