Skip to content

Commit 7832a9a

Browse files
committed
simplify deletion of attachments in DB
1 parent c228842 commit 7832a9a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

models/release.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,8 @@ func DeleteReleaseByID(id int64, doer *User, delTag bool) error {
381381
uuids = append(uuids, attachment.UUID)
382382
}
383383

384-
if _, err := x.In("uuid", uuids).Delete(new(Attachment)); err != nil {
385-
return err
386-
}
387-
388-
return nil
384+
_, err := x.Delete(&Attachment{ReleaseID: id})
385+
return err
389386
}
390387

391388
// SyncReleasesWithTags synchronizes release table with repository tags

0 commit comments

Comments
 (0)