From 483496cc260a4324c49e6738eda491d01fadb2c0 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 13 Aug 2021 21:36:16 +0200 Subject: [PATCH] Fix saving reminders of repeating tasks --- pkg/models/tasks.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index 8474b865..840129ea 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -974,6 +974,13 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) { ot.Reminders[i] = r.Reminder } + // When a repeating task is marked as done, we update all deadlines and reminders and set it as undone + updateDone(&ot, t) + + if err := setTaskBucket(s, t, &ot, t.BucketID != ot.BucketID); err != nil { + return err + } + // Update the assignees if err := ot.updateTaskAssignees(s, t.Assignees, a); err != nil { return err @@ -1004,14 +1011,6 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) { "kanban_position", } - // When a repeating task is marked as done, we update all deadlines and reminders and set it as undone - updateDone(&ot, t) - - err = setTaskBucket(s, t, &ot, t.BucketID != ot.BucketID) - if err != nil { - return err - } - // If the task is being moved between lists, make sure to move the bucket + index as well if t.ListID != 0 && ot.ListID != t.ListID { latestTask := &Task{}