1
0

fix(kanban): don't prevent setting a different bucket as done bucket

Resolves https://kolaente.dev/vikunja/frontend/issues/3373
This commit is contained in:
kolaente
2023-09-01 16:18:59 +02:00
parent 769b4f8d66
commit edbfc06a41
2 changed files with 20 additions and 7 deletions

View File

@ -293,10 +293,14 @@ func (b *Bucket) Update(s *xorm.Session, _ web.Auth) (err error) {
}
if doneBucket != nil && doneBucket.IsDoneBucket && b.IsDoneBucket && doneBucket.ID != b.ID {
return &ErrOnlyOneDoneBucketPerProject{
BucketID: b.ID,
ProjectID: b.ProjectID,
DoneBucketID: doneBucket.ID,
// When the current bucket will be the new done bucket, the old one should not be the done bucket anymore
doneBucket.IsDoneBucket = false
_, err = s.
Where("id = ?", doneBucket.ID).
Cols("is_done_bucket").
Update(doneBucket)
if err != nil {
return
}
}