mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Rename models.ProtectedBranchRepoID to models.EnvRepoID and ensure EnvPusherEmail is set (#12646)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
@ -217,6 +217,18 @@ func ServCommand(ctx *macaron.Context) {
|
||||
// so for now use the owner of the repository
|
||||
results.UserName = results.OwnerName
|
||||
results.UserID = repo.OwnerID
|
||||
if err = repo.GetOwner(); err != nil {
|
||||
log.Error("Unable to get owner for repo %-v. Error: %v", repo, err)
|
||||
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||
"results": results,
|
||||
"type": "InternalServerError",
|
||||
"err": fmt.Sprintf("Unable to get owner for repo: %s/%s.", results.OwnerName, results.RepoName),
|
||||
})
|
||||
return
|
||||
}
|
||||
if !repo.Owner.KeepEmailPrivate {
|
||||
results.UserEmail = repo.Owner.Email
|
||||
}
|
||||
} else {
|
||||
// Get the user represented by the Key
|
||||
var err error
|
||||
@ -239,6 +251,9 @@ func ServCommand(ctx *macaron.Context) {
|
||||
return
|
||||
}
|
||||
results.UserName = user.Name
|
||||
if !user.KeepEmailPrivate {
|
||||
results.UserEmail = user.Email
|
||||
}
|
||||
}
|
||||
|
||||
// Don't allow pushing if the repo is archived
|
||||
|
Reference in New Issue
Block a user