summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorMartin Kraft <martinkraft@gmail.com>2018-03-23 09:08:49 -0400
committerMartin Kraft <martinkraft@gmail.com>2018-03-23 09:08:49 -0400
commit5fa1b3581955761bd39c310bc88b1489d963a9fc (patch)
tree25e6dd11592102807abebbb5de100f7d867005d8 /api
parent37f0e5e0ebc0595efe2c65ffb84fa096dc8c5493 (diff)
parent87762ae62eb887dfb3fd0957040919aede46f7d4 (diff)
downloadchat-5fa1b3581955761bd39c310bc88b1489d963a9fc.tar.gz
chat-5fa1b3581955761bd39c310bc88b1489d963a9fc.tar.bz2
chat-5fa1b3581955761bd39c310bc88b1489d963a9fc.zip
Merge branch 'master' into advanced-permissions-phase-1
Diffstat (limited to 'api')
-rw-r--r--api/file_test.go3
-rw-r--r--api/user.go6
-rw-r--r--api/user_test.go3
3 files changed, 9 insertions, 3 deletions
diff --git a/api/file_test.go b/api/file_test.go
index 8e5fc6f67..7a04674cd 100644
--- a/api/file_test.go
+++ b/api/file_test.go
@@ -10,6 +10,7 @@ import (
"io/ioutil"
"net/http"
"os"
+ "path/filepath"
"strings"
"testing"
"time"
@@ -870,7 +871,7 @@ func TestGetInfoForFilename(t *testing.T) {
func readTestFile(name string) ([]byte, error) {
path, _ := utils.FindDir("tests")
- file, err := os.Open(path + "/" + name)
+ file, err := os.Open(filepath.Join(path, name))
if err != nil {
return nil, err
}
diff --git a/api/user.go b/api/user.go
index 14cc881dc..560d722a4 100644
--- a/api/user.go
+++ b/api/user.go
@@ -1170,7 +1170,11 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
teamId := relayProps["team_id"]
if len(teamId) > 0 {
c.App.Go(func() {
- c.App.AddDirectChannels(teamId, user)
+ if err := c.App.AddUserToTeamByTeamId(teamId, user); err != nil {
+ l4g.Error(err.Error())
+ } else {
+ c.App.AddDirectChannels(teamId, user)
+ }
})
}
case model.OAUTH_ACTION_EMAIL_TO_SSO:
diff --git a/api/user_test.go b/api/user_test.go
index f65d7c45b..518379305 100644
--- a/api/user_test.go
+++ b/api/user_test.go
@@ -12,6 +12,7 @@ import (
"mime/multipart"
"net/http"
"os"
+ "path/filepath"
"strings"
"testing"
"time"
@@ -778,7 +779,7 @@ func TestUserUploadProfileImage(t *testing.T) {
}
path, _ := utils.FindDir("tests")
- file, err := os.Open(path + "/test.png")
+ file, err := os.Open(filepath.Join(path, "test.png"))
if err != nil {
t.Fatal(err)
}