From 55cd40d175e33ca54248dc7fe6f47cc4ff9d0ad9 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 11 May 2020 18:39:30 +0200 Subject: [PATCH] Fix team rights not updating for namespace rights --- pkg/models/list_users.go | 4 ++-- pkg/models/namespace_team.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/models/list_users.go b/pkg/models/list_users.go index 9fdc01eb9a..5fdbb95f00 100644 --- a/pkg/models/list_users.go +++ b/pkg/models/list_users.go @@ -235,11 +235,11 @@ func (lu *ListUser) Update() (err error) { } // Check if the user exists - user, err := user.GetUserByUsername(lu.Username) + u, err := user.GetUserByUsername(lu.Username) if err != nil { return err } - lu.UserID = user.ID + lu.UserID = u.ID _, err = x. Where("list_id = ? AND user_id = ?", lu.ListID, lu.UserID). diff --git a/pkg/models/namespace_team.go b/pkg/models/namespace_team.go index 8029e6e541..13bafcc917 100644 --- a/pkg/models/namespace_team.go +++ b/pkg/models/namespace_team.go @@ -220,7 +220,7 @@ func (tn *TeamNamespace) Update() (err error) { } _, err = x. - Where("namespace_id = ? AND team_id = ?", tn.TeamID, tn.TeamID). + Where("namespace_id = ? AND team_id = ?", tn.NamespaceID, tn.TeamID). Cols("right"). Update(tn) return