Browse Source

fix-bug

tags/v1.22.3.2^2
liuzx 3 years ago
parent
commit
ef55b63c49
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      models/attachment.go

+ 2
- 0
models/attachment.go View File

@@ -62,6 +62,7 @@ type AttachmentInfo struct {
Attachment `xorm:"extends"`
Repo *Repository `xorm:"extends"`
RelAvatarLink string `xorm:"extends"`
UserName string `xorm:"extends"`
}

type AttachmentsOptions struct {
@@ -625,6 +626,7 @@ func Attachments(opts *AttachmentsOptions) ([]*AttachmentInfo, int64, error) {
user, err := GetUserByID(attachment.UploaderID)
if err == nil {
attachment.RelAvatarLink = user.RelAvatarLink()
attachment.UserName = user.Name
} else {
return nil, 0, fmt.Errorf("GetUserByID failed error: %v", err)
}


Loading…
Cancel
Save