mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-24 22:25:15 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user