diff options
author | Ethan Koenig <ethantkoenig@gmail.com> | 2018-01-07 23:48:37 -0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-01-08 09:48:37 +0200 |
commit | f48680888c14ad3dfe9cadb8efa4c8221731b71e (patch) | |
tree | 441f01ee6e43df6e28f86242dd983b2f52af8c8b /models/org_team.go | |
parent | cb868b78513b666905c8cd4facca68ed54c7f814 (diff) | |
download | gitea-f48680888c14ad3dfe9cadb8efa4c8221731b71e.tar.gz gitea-f48680888c14ad3dfe9cadb8efa4c8221731b71e.zip |
Remove IsOwner, NumTeams from OrgUser (#3269)
Diffstat (limited to 'models/org_team.go')
-rw-r--r-- | models/org_team.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/models/org_team.go b/models/org_team.go index c667cfb8e2..941b7ed2a1 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -518,22 +518,6 @@ func AddTeamMember(team *Team, userID int64) error { } } - // We make sure it exists before. - ou := new(OrgUser) - if _, err := sess. - Where("uid = ?", userID). - And("org_id = ?", team.OrgID). - Get(ou); err != nil { - return err - } - ou.NumTeams++ - if team.IsOwnerTeam() { - ou.IsOwner = true - } - if _, err := sess.ID(ou.ID).Cols("num_teams, is_owner").Update(ou); err != nil { - return err - } - return sess.Commit() } @@ -574,25 +558,6 @@ func removeTeamMember(e Engine, team *Team, userID int64) error { } } - // This must exist. - ou := new(OrgUser) - _, err = e. - Where("uid = ?", userID). - And("org_id = ?", team.OrgID). - Get(ou) - if err != nil { - return err - } - ou.NumTeams-- - if team.IsOwnerTeam() { - ou.IsOwner = false - } - if _, err = e. - ID(ou.ID). - Cols("num_teams"). - Update(ou); err != nil { - return err - } return nil } |