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/org_team.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/org_team.go')
-rw-r--r-- | models/org_team.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/org_team.go b/models/org_team.go index dcf0743740..1786376d02 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -362,6 +362,11 @@ func GetTeam(orgID int64, name string) (*Team, error) { return getTeam(x, orgID, name) } +// getOwnerTeam returns team by given team name and organization. +func getOwnerTeam(e Engine, orgID int64) (*Team, error) { + return getTeam(e, orgID, ownerTeamName) +} + func getTeamByID(e Engine, teamID int64) (*Team, error) { t := new(Team) has, err := e.ID(teamID).Get(t) |