Fix owner field being null for user shared namespaces (#119)
This commit is contained in:
parent
a0c5e4e985
commit
1d2cdf0fb8
1 changed files with 2 additions and 0 deletions
|
@ -181,9 +181,11 @@ func (n *Namespace) ReadAll(a web.Auth, search string, page int, perPage int) (r
|
|||
Table("namespaces").
|
||||
Join("LEFT", "team_namespaces", "namespaces.id = team_namespaces.namespace_id").
|
||||
Join("LEFT", "team_members", "team_members.team_id = team_namespaces.team_id").
|
||||
Join("LEFT", "users_namespace", "users_namespace.namespace_id = namespaces.id").
|
||||
Join("INNER", "users", "users.id = namespaces.owner_id").
|
||||
Where("team_members.user_id = ?", doer.ID).
|
||||
Or("namespaces.owner_id = ?", doer.ID).
|
||||
Or("users_namespace.user_id = ?", doer.ID).
|
||||
GroupBy("users.id").
|
||||
Find(&users)
|
||||
|
||||
|
|
Loading…
Reference in a new issue