1
0

fix(assignees): subscribe assigned users directly to the task, not async

Resolves https://community.vikunja.io/t/richer-email-notifications/1891
This commit is contained in:
kolaente
2024-01-28 13:15:43 +01:00
parent b2970c6c04
commit e4fec01d52
2 changed files with 11 additions and 34 deletions

View File

@ -256,6 +256,17 @@ func (t *Task) addNewAssigneeByID(s *xorm.Session, newAssigneeID int64, project
return err
}
sub := &Subscription{
UserID: newAssigneeID,
EntityType: SubscriptionEntityTask,
EntityID: t.ID,
}
err = sub.Create(s, newAssignee)
if err != nil && !IsErrSubscriptionAlreadyExists(err) {
return err
}
doer, _ := user.GetFromAuth(auth)
err = events.Dispatch(&TaskAssigneeCreatedEvent{
Task: t,