Browse Source

fix

tags/v1.21.7.1
lewis 4 years ago
parent
commit
e1ae212e51
2 changed files with 3 additions and 0 deletions
  1. +1
    -0
      modules/convert/convert.go
  2. +2
    -0
      modules/structs/user.go

+ 1
- 0
modules/convert/convert.go View File

@@ -335,6 +335,7 @@ func ToUser(user *models.User, signed, authed bool) *api.User {
AvatarURL: user.AvatarLink(),
FullName: markup.Sanitize(user.FullName),
Created: user.CreatedUnix.AsTime(),
IsActive: user.IsActive,
}
// hide primary email if API caller is anonymous or user keep email private
if signed && (!user.KeepEmailPrivate || authed) {


+ 2
- 0
modules/structs/user.go View File

@@ -26,6 +26,8 @@ type User struct {
Language string `json:"language"`
// Is the user an administrator
IsAdmin bool `json:"is_admin"`
// Is the user active
IsActive bool `json:"is_active"`
// swagger:strfmt date-time
LastLogin time.Time `json:"last_login,omitempty"`
// swagger:strfmt date-time


Loading…
Cancel
Save