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