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 /routers/org/members.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 'routers/org/members.go')
-rw-r--r-- | routers/org/members.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/org/members.go b/routers/org/members.go index d65bc2a008..20f80cefcd 100644 --- a/routers/org/members.go +++ b/routers/org/members.go @@ -19,7 +19,7 @@ const ( tplMembers base.TplName = "org/member/members" ) -// Members render orgnization users page +// Members render organization users page func Members(ctx *context.Context) { org := ctx.Org.Organization ctx.Data["Title"] = org.FullName @@ -30,11 +30,14 @@ func Members(ctx *context.Context) { return } ctx.Data["Members"] = org.Members + ctx.Data["MembersIsPublicMember"] = org.MembersIsPublic + ctx.Data["MembersIsUserOrgOwner"] = org.Members.IsUserOrgOwner(org.ID) + ctx.Data["MembersTwoFaStatus"] = org.Members.GetTwoFaStatus() ctx.HTML(200, tplMembers) } -// MembersAction response for operation to a member of orgnization +// MembersAction response for operation to a member of organization func MembersAction(ctx *context.Context) { uid := com.StrTo(ctx.Query("uid")).MustInt64() if uid == 0 { |