fix(projects): do not return parent project id when authenticating as link share
Related to https://community.vikunja.io/t/vikunja-freezes/2246 Related to https://github.com/go-vikunja/vikunja/issues/233
This commit is contained in:
parent
0bc9a670d7
commit
500b761fe6
@ -146,6 +146,9 @@ func (p *Project) ReadAll(s *xorm.Session, a web.Auth, search string, page int,
|
|||||||
}
|
}
|
||||||
projects := []*Project{project}
|
projects := []*Project{project}
|
||||||
err = addProjectDetails(s, projects, a)
|
err = addProjectDetails(s, projects, a)
|
||||||
|
if err == nil && len(projects) > 0 {
|
||||||
|
projects[0].ParentProjectID = 0
|
||||||
|
}
|
||||||
return projects, 0, 0, err
|
return projects, 0, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,6 +229,11 @@ func (p *Project) ReadOne(s *xorm.Session, a web.Auth) (err error) {
|
|||||||
p.OwnerID = sf.OwnerID
|
p.OwnerID = sf.OwnerID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_, isShareAuth := a.(*LinkSharing)
|
||||||
|
if isShareAuth {
|
||||||
|
p.ParentProjectID = 0
|
||||||
|
}
|
||||||
|
|
||||||
// Get project owner
|
// Get project owner
|
||||||
p.Owner, err = user.GetUserByID(s, p.OwnerID)
|
p.Owner, err = user.GetUserByID(s, p.OwnerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user