Fixed tests failing
This commit is contained in:
parent
f4ac036f27
commit
224cebfd10
3 changed files with 3 additions and 3 deletions
|
@ -78,7 +78,7 @@ func (l *List) checkListTeamRight(user *User, r TeamRight) bool {
|
|||
Join("LEFT", []string{"team_members", "tm"}, "tm.team_id = tn.team_id").
|
||||
Join("LEFT", []string{"team_list", "tl"}, "l.id = tl.list_id").
|
||||
Join("LEFT", []string{"team_members", "tm2"}, "tm2.team_id = tl.team_id").
|
||||
Where("((tm.user_id = ? AND tn.right = ?) OR (tm2.user_id = ? AND tl.rights = ?)) AND l.id = ?",
|
||||
Where("((tm.user_id = ? AND tn.right = ?) OR (tm2.user_id = ? AND tl.right = ?)) AND l.id = ?",
|
||||
user.ID, r, user.ID, r, l.ID).
|
||||
Exist(&List{})
|
||||
if err != nil {
|
||||
|
|
|
@ -80,7 +80,7 @@ func (n *Namespace) checkTeamRights(user *User, r TeamRight) bool {
|
|||
Join("LEFT", "team_namespaces", "namespaces.id = team_namespaces.namespace_id").
|
||||
Join("LEFT", "team_members", "team_members.team_id = team_namespaces.team_id").
|
||||
Where("namespaces.id = ? "+
|
||||
"AND ((team_members.user_id = ? AND team_namespaces.right = ?) "+
|
||||
"AND (team_members.user_id = ? AND team_namespaces.right = ?) "+
|
||||
"OR namespaces.owner_id = ? ", n.ID, user.ID, r, user.ID).
|
||||
Get(&Namespace{})
|
||||
if err != nil {
|
||||
|
|
|
@ -52,7 +52,7 @@ func TestNamespace_Create(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Try updating one with a nonexistant owner
|
||||
dummynamespace.OwnerID = 94829838572
|
||||
dummynamespace.Owner.ID = 94829838572
|
||||
err = dummynamespace.Update()
|
||||
assert.Error(t, err)
|
||||
assert.True(t, IsErrUserDoesNotExist(err))
|
||||
|
|
Loading…
Reference in a new issue