Add copying assignees

This commit is contained in:
kolaente 2020-06-29 22:27:45 +02:00
parent 7e4cd207c2
commit 28a4944dd3
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 20 additions and 1 deletions

View File

@ -137,7 +137,26 @@ func (ld *ListDuplicate) Create(a web.Auth) (err error) {
}
}
// * assignees
// Assignees
// Only copy those assignees who have access to the task
assignees := []*TaskAssginee{}
err = x.In("task_id", oldTaskIDs).Find(&assignees)
if err != nil {
return
}
for _, a := range assignees {
t := &Task{
ID: taskMap[a.TaskID],
ListID: ld.List.ID,
}
if err := t.addNewAssigneeByID(a.UserID, ld.List); err != nil {
if IsErrUserDoesNotHaveAccessToList(err) {
continue
}
return err
}
}
// * comments
// * relations in that list
// * reminders