Add copying assignees
This commit is contained in:
parent
7e4cd207c2
commit
28a4944dd3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue