diff options
author | Lauris BH <lauris@nix.lv> | 2017-06-21 03:57:05 +0300 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-21 08:57:05 +0800 |
commit | 6db387a21e245dc4aa7f009ca60574e42d934ffb (patch) | |
tree | 5f5dcd1b4cd3409e3fc1c4e2a0799ce85a09c3c0 /models/org_team.go | |
parent | 754482bf5d4922f0553c281ac525daff3f446c22 (diff) | |
download | gitea-6db387a21e245dc4aa7f009ca60574e42d934ffb.tar.gz gitea-6db387a21e245dc4aa7f009ca60574e42d934ffb.zip |
Refactor session close as xorm already does everything needed internally (#2020)
Diffstat (limited to 'models/org_team.go')
-rw-r--r-- | models/org_team.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/org_team.go b/models/org_team.go index 5c97a7032e..a7a1ba85d6 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -119,7 +119,7 @@ func (t *Team) AddRepository(repo *Repository) (err error) { } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } @@ -180,7 +180,7 @@ func (t *Team) RemoveRepository(repoID int64) error { } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } @@ -309,7 +309,7 @@ func UpdateTeam(t *Team, authChanged bool) (err error) { } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err = sess.Begin(); err != nil { return err } @@ -354,7 +354,7 @@ func DeleteTeam(t *Team) error { } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err := sess.Begin(); err != nil { return err } @@ -482,7 +482,7 @@ func AddTeamMember(team *Team, userID int64) error { } sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err := sess.Begin(); err != nil { return err } @@ -584,7 +584,7 @@ func removeTeamMember(e Engine, team *Team, userID int64) error { // RemoveTeamMember removes member from given team of given organization. func RemoveTeamMember(team *Team, userID int64) error { sess := x.NewSession() - defer sessionRelease(sess) + defer sess.Close() if err := sess.Begin(); err != nil { return err } |