@@ -195,18 +195,18 @@ func UpdateRelease(doer *models.User, gitRepo *git.Repository, rel *models.Relea
195
195
}
196
196
defer commiter .Close ()
197
197
198
- if err = models .UpdateRelease (& ctx , rel ); err != nil {
198
+ if err = models .UpdateRelease (ctx , rel ); err != nil {
199
199
return err
200
200
}
201
201
202
- if err = models .AddReleaseAttachments (& ctx , rel .ID , addAttachmentUUIDs ); err != nil {
202
+ if err = models .AddReleaseAttachments (ctx , rel .ID , addAttachmentUUIDs ); err != nil {
203
203
return fmt .Errorf ("AddReleaseAttachments: %v" , err )
204
204
}
205
205
206
206
var deletedUUIDsMap = make (map [string ]bool )
207
207
if len (delAttachmentUUIDs ) > 0 {
208
208
// Check attachments
209
- attachments , err := models .GetAttachmentsByUUIDs (& ctx , delAttachmentUUIDs )
209
+ attachments , err := models .GetAttachmentsByUUIDs (ctx , delAttachmentUUIDs )
210
210
if err != nil {
211
211
return fmt .Errorf ("GetAttachmentsByUUIDs [uuids: %v]: %v" , delAttachmentUUIDs , err )
212
212
}
@@ -217,7 +217,7 @@ func UpdateRelease(doer *models.User, gitRepo *git.Repository, rel *models.Relea
217
217
deletedUUIDsMap [attach .UUID ] = true
218
218
}
219
219
220
- if _ , err := models .DeleteAttachments (& ctx , attachments , false ); err != nil {
220
+ if _ , err := models .DeleteAttachments (ctx , attachments , false ); err != nil {
221
221
return fmt .Errorf ("DeleteAttachments [uuids: %v]: %v" , delAttachmentUUIDs , err )
222
222
}
223
223
}
@@ -228,7 +228,7 @@ func UpdateRelease(doer *models.User, gitRepo *git.Repository, rel *models.Relea
228
228
updateAttachmentsList = append (updateAttachmentsList , k )
229
229
}
230
230
// Check attachments
231
- attachments , err := models .GetAttachmentsByUUIDs (& ctx , updateAttachmentsList )
231
+ attachments , err := models .GetAttachmentsByUUIDs (ctx , updateAttachmentsList )
232
232
if err != nil {
233
233
return fmt .Errorf ("GetAttachmentsByUUIDs [uuids: %v]: %v" , updateAttachmentsList , err )
234
234
}
@@ -240,7 +240,7 @@ func UpdateRelease(doer *models.User, gitRepo *git.Repository, rel *models.Relea
240
240
241
241
for uuid , newName := range editAttachments {
242
242
if ! deletedUUIDsMap [uuid ] {
243
- if err = models .UpdateAttachmentByUUID (& ctx , & models.Attachment {
243
+ if err = models .UpdateAttachmentByUUID (ctx , & models.Attachment {
244
244
UUID : uuid ,
245
245
Name : newName ,
246
246
}, "name" ); err != nil {
0 commit comments