mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 11:37:52 +01:00
Remove unneeded database loads (#814)
Remove unnecessary calls to repo.GetOwner() in context handlers
This commit is contained in:
parent
d7d094bd8a
commit
73d05a51e3
@ -185,10 +185,8 @@ func RepoAssignment(args ...bool) macaron.Handler {
|
|||||||
ctx.Handle(500, "GetRepositoryByName", err)
|
ctx.Handle(500, "GetRepositoryByName", err)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
} else if err = repo.GetOwner(); err != nil {
|
|
||||||
ctx.Handle(500, "GetOwner", err)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
repo.Owner = owner
|
||||||
|
|
||||||
// Admin has super access.
|
// Admin has super access.
|
||||||
if ctx.IsSigned && ctx.User.IsAdmin {
|
if ctx.IsSigned && ctx.User.IsAdmin {
|
||||||
|
@ -57,10 +57,8 @@ func repoAssignment() macaron.Handler {
|
|||||||
ctx.Error(500, "GetRepositoryByName", err)
|
ctx.Error(500, "GetRepositoryByName", err)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
} else if err = repo.GetOwner(); err != nil {
|
|
||||||
ctx.Error(500, "GetOwner", err)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
repo.Owner = owner
|
||||||
|
|
||||||
if ctx.IsSigned && ctx.User.IsAdmin {
|
if ctx.IsSigned && ctx.User.IsAdmin {
|
||||||
ctx.Repo.AccessMode = models.AccessModeOwner
|
ctx.Repo.AccessMode = models.AccessModeOwner
|
||||||
|
Loading…
Reference in New Issue
Block a user