forked from forgejo/forgejo
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
parent
1d98d205f5
commit
54e9ee37a7
423 changed files with 1585 additions and 1758 deletions
|
@ -100,12 +100,12 @@ func GetAttachment(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if repository == nil { //If not linked
|
||||
if !(ctx.IsSigned && attach.UploaderID == ctx.User.ID) { //We block if not the uploader
|
||||
if repository == nil { // If not linked
|
||||
if !(ctx.IsSigned && attach.UploaderID == ctx.User.ID) { // We block if not the uploader
|
||||
ctx.Error(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
} else { //If we have the repository we check access
|
||||
} else { // If we have the repository we check access
|
||||
perm, err := models.GetUserRepoPermission(repository, ctx.User)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetUserRepoPermission", err.Error())
|
||||
|
@ -123,7 +123,7 @@ func GetAttachment(ctx *context.Context) {
|
|||
}
|
||||
|
||||
if setting.Attachment.ServeDirect {
|
||||
//If we have a signed url (S3, object storage), redirect to this directly.
|
||||
// If we have a signed url (S3, object storage), redirect to this directly.
|
||||
u, err := storage.Attachments.URL(attach.RelativePath(), attach.Name)
|
||||
|
||||
if u != nil && err == nil {
|
||||
|
@ -136,7 +136,7 @@ func GetAttachment(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
//If we have matched and access to release or issue
|
||||
// If we have matched and access to release or issue
|
||||
fr, err := storage.Attachments.Open(attach.RelativePath())
|
||||
if err != nil {
|
||||
ctx.ServerError("Open", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue