Make sure task relations are properly attributed to link shares

This commit is contained in:
kolaente 2021-04-07 11:59:56 +02:00
parent f9ee426b64
commit 1af4598400
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 2 deletions

View File

@ -144,13 +144,17 @@ func (rel *TaskRelation) Create(s *xorm.Session, a web.Auth) error {
}
}
rel.CreatedByID = a.GetID()
rel.CreatedBy, err = getUserOrLinkShareUser(s, a)
if err != nil {
return err
}
rel.CreatedByID = rel.CreatedBy.ID
// Build up the other relation (see the comment above for explanation)
otherRelation := &TaskRelation{
TaskID: rel.OtherTaskID,
OtherTaskID: rel.TaskID,
CreatedByID: a.GetID(),
CreatedByID: rel.CreatedByID,
}
switch rel.RelationKind {