forked from vikunja/vikunja
fix(docs): explain why we use NoAutoTime().
Add a comment explaining why we use NoAutoTime() when synchronizing the positions of tasks in a bucket/project.
This commit is contained in:
parent
4f55099896
commit
49a790fdad
|
@ -1081,6 +1081,10 @@ func recalculateTaskKanbanPositions(s *xorm.Session, bucketID int64) (err error)
|
|||
|
||||
currentPosition := maxPosition / float64(len(allTasks)) * (float64(i + 1))
|
||||
|
||||
// Here we use "NoAutoTime() to prevent the ORM from updating column "updated" automatically.
|
||||
// Otherwise, this signals to CalDAV clients that the task has changed, which is not the case.
|
||||
// Consequence: when synchronizing a list of tasks, the first one immediately changes the date of all the
|
||||
// following ones from the same batch, which are then unable to be updated.
|
||||
_, err = s.Cols("kanban_position").
|
||||
Where("id = ?", task.ID).
|
||||
NoAutoTime().
|
||||
|
@ -1110,6 +1114,10 @@ func recalculateTaskPositions(s *xorm.Session, projectID int64) (err error) {
|
|||
|
||||
currentPosition := maxPosition / float64(len(allTasks)) * (float64(i + 1))
|
||||
|
||||
// Here we use "NoAutoTime() to prevent the ORM from updating column "updated" automatically.
|
||||
// Otherwise, this signals to CalDAV clients that the task has changed, which is not the case.
|
||||
// Consequence: when synchronizing a list of tasks, the first one immediately changes the date of all the
|
||||
// following ones from the same batch, which are then unable to be updated.
|
||||
_, err = s.Cols("position").
|
||||
Where("id = ?", task.ID).
|
||||
NoAutoTime().
|
||||
|
|
Loading…
Reference in New Issue