fix(webhook): actually fetch project before enriching details

This fixes a bug where the project is fetched before adding more details
through ReadOne since ReadOne does not fetch the project. In the normal
project reading flow through the api, this is done in the permission
check.

Resolves https://github.com/go-vikunja/vikunja/issues/1498
This commit is contained in:
kolaente
2025-09-17 17:04:26 +02:00
parent fc666e57da
commit fb426a6e22

View File

@@ -906,7 +906,11 @@ func reloadEventData(s *xorm.Session, event map[string]interface{}, projectID in
}
if _, has := event["project"]; has && doerID != 0 {
project := &Project{ID: projectID}
var project *Project
project, err = GetProjectSimpleByID(s, projectID)
if err != nil && !IsErrProjectDoesNotExist(err) {
return
}
err = project.ReadOne(s, &user.User{ID: doerID})
if err != nil && !IsErrProjectDoesNotExist(err) {
return