fix: make cover image id actually updatable

This commit is contained in:
kolaente 2022-10-02 13:44:56 +02:00
parent 0e1904d50b
commit 0eb47096db
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 5 additions and 1 deletions

View File

@ -1042,7 +1042,7 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) {
"position",
"repeat_mode",
"kanban_position",
"cover_image_attachment_id",
"cover_image_attachment_id", // TODO: check if the attachment belongs to the task
}
// If the task is being moved between lists, make sure to move the bucket + index as well
@ -1152,6 +1152,10 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) {
if !t.IsFavorite {
ot.IsFavorite = false
}
// Attachment cover image
if t.CoverImageAttachmentID == 0 {
ot.CoverImageAttachmentID = 0
}
_, err = s.ID(t.ID).
Cols(colsToUpdate...).