aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/attachment.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-04-03 03:25:05 +0800
committertechknowlogick <matti@mdranta.net>2019-04-02 15:25:05 -0400
commit09fb036ad625ec5178319c30df47aac313fdbbe3 (patch)
tree4e5389c39924532023041d530b02a94d3bf987d2 /routers/repo/attachment.go
parent0a8e63c68292a08d8a7bc4fa397ae41235f086a7 (diff)
downloadgitea-09fb036ad625ec5178319c30df47aac313fdbbe3.tar.gz
gitea-09fb036ad625ec5178319c30df47aac313fdbbe3.zip
fix upload attachments (#6481)
* fix upload attachments * add migration for new column uploader_id on table attachment * fix imports sequence
Diffstat (limited to 'routers/repo/attachment.go')
-rw-r--r--routers/repo/attachment.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go
index 302f5b33f7..8913e63015 100644
--- a/routers/repo/attachment.go
+++ b/routers/repo/attachment.go
@@ -60,7 +60,10 @@ func UploadAttachment(ctx *context.Context) {
return
}
- attach, err := models.NewAttachment(header.Filename, buf, file)
+ attach, err := models.NewAttachment(&models.Attachment{
+ UploaderID: ctx.User.ID,
+ Name: header.Filename,
+ }, buf, file)
if err != nil {
ctx.Error(500, fmt.Sprintf("NewAttachment: %v", err))
return