]> source.dussan.org Git - gitea.git/commitdiff
parseScope with owner/repo always sets owner to zero (#25987) (#25989)
authorGiteabot <teabot@gitea.io>
Wed, 19 Jul 2023 14:57:17 +0000 (10:57 -0400)
committerGitHub <noreply@github.com>
Wed, 19 Jul 2023 14:57:17 +0000 (22:57 +0800)
Backport #25987 by @earl-warren

Refs: https://codeberg.org/forgejo/forgejo/pulls/1001

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
routers/private/actions.go

index b7e416f56a33b7ee40730f96ce3e16f3667fd319..2403b9c41a0b4c236acb12cd6308ab0561ee088a 100644 (file)
@@ -77,9 +77,10 @@ func parseScope(ctx *context.PrivateContext, scope string) (ownerID, repoID int6
        if err != nil {
                return ownerID, repoID, err
        }
+       ownerID = u.ID
 
        if !found {
-               return u.ID, repoID, nil
+               return ownerID, repoID, nil
        }
 
        r, err := repo_model.GetRepositoryByName(u.ID, repoName)