fix: Actor is required to get user repositories#20443
Conversation
|
what we could do to not have a panic but an error: check for actor == nil and if so return an error.New("Actor is needed but not given") |
|
So, the panic was thrown because instead of passing in the user model directly through the Lines 71 to 78 in 7690de5 As per the reviews, I think 2 changes need to be done:
|
492aa2b to
645f58b
Compare
zeripath
left a comment
There was a problem hiding this comment.
I have a feeling we should change repo_model.GetUserRepositories to use OwnerID and not Actor to list the UserRepositories. However, this does fix the bug.
I apologise for merging the PR with this bug - it is due to a mismerge.
Signed-off-by: Andrew Thornton <art27@cantab.net>
|
I've added a test case too |
|
Doesn't need backporting as far as I'm aware as purging hasn't been backported |
|
🚀 |
* giteaofficial/main: Fix Ruby package parsing by removed unused email field (go-gitea#20470) [skip ci] Updated translations via Crowdin Add repository condition for issue count (go-gitea#20454) Prepend commit message to template content (go-gitea#20429) Improve pprof doc (go-gitea#20463) Improve code diff highlight, fix incorrect rendered diff result (go-gitea#19958) Add Cache-Control header to html and api responses, add no-transform (go-gitea#20432) [skip ci] Updated translations via Crowdin Allow non-semver packages in the Conan package registry (go-gitea#20412) Use body text color in repository files table links (go-gitea#20386) Correct code block in installation docs for Snap (go-gitea#20440) Downgrade golangci-lint to 1.47.0 (go-gitea#20445) Add eslint-plugin-sonarjs (go-gitea#20431) Fix: Actor is required to get user repositories (go-gitea#20443) Add "X-Gitea-Object-Type" header for GET `/raw/` & `/media/` API (go-gitea#20438) Simplify visibility checks (go-gitea#20406)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton <art27@cantab.net>
fixes: #20442