mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #6952 from huydx/format-gofmt
(format) run go fmt in pkg
This commit is contained in:
@@ -56,7 +56,7 @@ func OAuthLogin(ctx *middleware.Context) {
|
||||
if setting.OAuthService.OAuthInfos[name].HostedDomain == "" {
|
||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
|
||||
} else {
|
||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline));
|
||||
ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import (
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
|
||||
type DatabaseConfig struct {
|
||||
Type, Host, Name, User, Pwd, Path, SslMode string
|
||||
CaCertPath string
|
||||
|
||||
@@ -186,7 +186,7 @@ func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error) {
|
||||
Email: data.Email,
|
||||
}
|
||||
|
||||
if (userInfo.Email == "" && data.Attributes["email:primary"] != nil) {
|
||||
if userInfo.Email == "" && data.Attributes["email:primary"] != nil {
|
||||
userInfo.Email = data.Attributes["email:primary"][0]
|
||||
}
|
||||
|
||||
@@ -197,11 +197,11 @@ func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if (userInfo.Login == "" && data.Username != "") {
|
||||
if userInfo.Login == "" && data.Username != "" {
|
||||
userInfo.Login = data.Username
|
||||
}
|
||||
|
||||
if (userInfo.Login == "") {
|
||||
if userInfo.Login == "" {
|
||||
userInfo.Login = data.Email
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ package opentsdb
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/tsdb"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
)
|
||||
|
||||
func TestOpenTsdbExecutor(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user