diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-08-02 18:06:28 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-08-02 12:06:27 -0400 |
commit | 76408d50fb338e9239ee06bb26eec28453167300 (patch) | |
tree | 552f49cb095e9744c11f71dba9a3910a7d0ceb18 /models/user.go | |
parent | 3566d2c860b0ad3ab7d6d5fb1490eb9a5b5f5974 (diff) | |
download | gitea-76408d50fb338e9239ee06bb26eec28453167300.tar.gz gitea-76408d50fb338e9239ee06bb26eec28453167300.zip |
org/members: display 2FA members states + optimize sql requests (#7621)
* org/members: display 2FA state
* fix comment typo
* lay down UserList bases
* add basic test for previous methods
* add comment for UserList type
* add valid two-fa account
* test new UserList methods
* optimize MembersIsPublic by side loading info on GetMembers + fix integrations tests
* respect fmt rules
* use map for data
* Optimize GetTwoFaStatus
* rewrite by using existing sub func
* Optimize IsUserOrgOwner
* remove un-used code
* tests: cover empty org + fix import order
* tests: add ErrTeamNotExist path
* tests: fix wrong expected result
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/models/user.go b/models/user.go index 1f684a5940..ab29683a7b 100644 --- a/models/user.go +++ b/models/user.go @@ -139,11 +139,12 @@ type User struct { NumRepos int // For organization - NumTeams int - NumMembers int - Teams []*Team `xorm:"-"` - Members []*User `xorm:"-"` - Visibility structs.VisibleType `xorm:"NOT NULL DEFAULT 0"` + NumTeams int + NumMembers int + Teams []*Team `xorm:"-"` + Members UserList `xorm:"-"` + MembersIsPublic map[int64]bool `xorm:"-"` + Visibility structs.VisibleType `xorm:"NOT NULL DEFAULT 0"` // Preferences DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"` |