mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Add error info if no user can fork the repo (#25820)
Before: (Owner list is empty)  After: (Disable the button and show the error info) 
This commit is contained in:
@ -174,6 +174,12 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository {
|
||||
ctx.Data["ContextUser"] = ctx.Doer
|
||||
} else if len(orgs) > 0 {
|
||||
ctx.Data["ContextUser"] = orgs[0]
|
||||
} else {
|
||||
msg := ctx.Tr("repo.fork_no_valid_owners")
|
||||
ctx.Data["Flash"] = ctx.Flash
|
||||
ctx.Flash.Error(msg)
|
||||
ctx.Data["CanForkRepo"] = false
|
||||
return nil
|
||||
}
|
||||
|
||||
return forkRepo
|
||||
|
Reference in New Issue
Block a user