diff --git a/pkg/api/org_users.go b/pkg/api/org_users.go index 02c376eed30..57a15bd8db5 100644 --- a/pkg/api/org_users.go +++ b/pkg/api/org_users.go @@ -1,6 +1,7 @@ package api import ( + "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/middleware" m "github.com/grafana/grafana/pkg/models" @@ -31,10 +32,6 @@ func addOrgUserHelper(cmd m.AddOrgUserCommand) Response { userToAdd := userQuery.Result - // if userToAdd.Id == c.UserId { - // return ApiError(400, "Cannot add yourself as user", nil) - // } - cmd.UserId = userToAdd.Id if err := bus.Dispatch(&cmd); err != nil { @@ -64,6 +61,10 @@ func getOrgUsersHelper(orgId int64) Response { return ApiError(500, "Failed to get account user", err) } + for _, user := range query.Result { + user.AvatarUrl = dtos.GetGravatarUrl(user.Email) + } + return Json(200, query.Result) } diff --git a/pkg/models/org_user.go b/pkg/models/org_user.go index ef5fd76a813..7002c2206fa 100644 --- a/pkg/models/org_user.go +++ b/pkg/models/org_user.go @@ -115,6 +115,7 @@ type OrgUserDTO struct { OrgId int64 `json:"orgId"` UserId int64 `json:"userId"` Email string `json:"email"` + AvatarUrl string `json:"avatarUrl"` Login string `json:"login"` Role string `json:"role"` LastSeenAt time.Time `json:"lastSeenAt"` diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html index ddd21eae463..8c7af5d70cd 100644 --- a/public/app/features/dashboard/partials/settings.html +++ b/public/app/features/dashboard/partials/settings.html @@ -85,16 +85,12 @@ -
+
-
+
-
- -
-
diff --git a/public/app/features/org/partials/orgUsers.html b/public/app/features/org/partials/orgUsers.html index 22afa60acf4..fe11216f30d 100644 --- a/public/app/features/org/partials/orgUsers.html +++ b/public/app/features/org/partials/orgUsers.html @@ -8,7 +8,6 @@
-