mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 00:45:22 +02:00
fix upload attachments (#6481)
* fix upload attachments * add migration for new column uploader_id on table attachment * fix imports sequence
This commit is contained in:
parent
0a8e63c682
commit
09fb036ad6
7 changed files with 76 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue