mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-17 23:42:52 +00:00
Renamed ctx.User to ctx.Doer. (#19161)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
5495ba7660
commit
80fd25524e
129 changed files with 881 additions and 881 deletions
|
@ -170,7 +170,7 @@ func PostLockHandler(ctx *context.Context) {
|
|||
|
||||
lock, err := models.CreateLFSLock(repository, &models.LFSLock{
|
||||
Path: req.Path,
|
||||
OwnerID: ctx.User.ID,
|
||||
OwnerID: ctx.Doer.ID,
|
||||
})
|
||||
if err != nil {
|
||||
if models.IsErrLFSLockAlreadyExist(err) {
|
||||
|
@ -187,7 +187,7 @@ func PostLockHandler(ctx *context.Context) {
|
|||
})
|
||||
return
|
||||
}
|
||||
log.Error("Unable to CreateLFSLock in repository %-v at %s for user %-v: Error: %v", repository, req.Path, ctx.User, err)
|
||||
log.Error("Unable to CreateLFSLock in repository %-v at %s for user %-v: Error: %v", repository, req.Path, ctx.Doer, err)
|
||||
ctx.JSON(http.StatusInternalServerError, api.LFSLockError{
|
||||
Message: "internal server error : Internal Server Error",
|
||||
})
|
||||
|
@ -249,7 +249,7 @@ func VerifyLockHandler(ctx *context.Context) {
|
|||
lockOursListAPI := make([]*api.LFSLock, 0, len(lockList))
|
||||
lockTheirsListAPI := make([]*api.LFSLock, 0, len(lockList))
|
||||
for _, l := range lockList {
|
||||
if l.OwnerID == ctx.User.ID {
|
||||
if l.OwnerID == ctx.Doer.ID {
|
||||
lockOursListAPI = append(lockOursListAPI, convert.ToLFSLock(l))
|
||||
} else {
|
||||
lockTheirsListAPI = append(lockTheirsListAPI, convert.ToLFSLock(l))
|
||||
|
@ -301,7 +301,7 @@ func UnLockHandler(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
lock, err := models.DeleteLFSLockByID(ctx.ParamsInt64("lid"), repository, ctx.User, req.Force)
|
||||
lock, err := models.DeleteLFSLockByID(ctx.ParamsInt64("lid"), repository, ctx.Doer, req.Force)
|
||||
if err != nil {
|
||||
if models.IsErrLFSUnauthorizedAction(err) {
|
||||
ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=gitea-lfs")
|
||||
|
@ -310,7 +310,7 @@ func UnLockHandler(ctx *context.Context) {
|
|||
})
|
||||
return
|
||||
}
|
||||
log.Error("Unable to DeleteLFSLockByID[%d] by user %-v with force %t: Error: %v", ctx.ParamsInt64("lid"), ctx.User, req.Force, err)
|
||||
log.Error("Unable to DeleteLFSLockByID[%d] by user %-v with force %t: Error: %v", ctx.ParamsInt64("lid"), ctx.Doer, req.Force, err)
|
||||
ctx.JSON(http.StatusInternalServerError, api.LFSLockError{
|
||||
Message: "unable to delete lock : Internal Server Error",
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue