From 34b92cdb440e175884b45df7197a65b086ff0eac Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 20 Dec 2016 23:23:57 -0500 Subject: [PATCH] Fix #3905 --- .gopmfile | 6 +++--- README.md | 2 +- glide.lock | 6 +++--- gogs.go | 2 +- models/models.go | 1 + models/org.go | 2 +- models/org_team.go | 10 +++++----- templates/.VERSION | 2 +- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gopmfile b/.gopmfile index 4e061e700..a30329171 100644 --- a/.gopmfile +++ b/.gopmfile @@ -14,9 +14,9 @@ github.com/go-macaron/inject = commit:c5ab7bf github.com/go-macaron/session = commit:66031fc github.com/go-macaron/toolbox = commit:82b5115 github.com/go-sql-driver/mysql = commit:0b58b37 -github.com/go-xorm/builder = commit:cd42e83 -github.com/go-xorm/core = commit:2ec3936 -github.com/go-xorm/xorm = commit:311abf2 +github.com/go-xorm/builder = commit:db75972 +github.com/go-xorm/core = commit:87aca22 +github.com/go-xorm/xorm = commit:3ad0b42 github.com/gogits/chardet = commit:2404f77 github.com/gogits/cron = commit:7f3990a github.com/gogits/git-module = commit:7129215 diff --git a/README.md b/README.md index d3e1786be..0aedd4611 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) -##### Current tip version: 0.9.101 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)) +##### Current tip version: 0.9.102 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)) | Web | UI | Preview | |:-------------:|:-------:|:-------:| diff --git a/glide.lock b/glide.lock index 84ee23f20..dee3f6be7 100644 --- a/glide.lock +++ b/glide.lock @@ -33,11 +33,11 @@ imports: - name: github.com/go-sql-driver/mysql version: 0b58b37b664c21f3010e836f1b931e1d0b0b0685 - name: github.com/go-xorm/builder - version: cd42e8337f3031e737c3f415b6354793cf30f1c9 + version: db75972580de4a7c6c20fff5b16a924c3de3fa12 - name: github.com/go-xorm/core - version: 2ec3936f8a8a3fb6397c6c10185acffa87488534 + version: 87aca223378aab7a4bf31ef53f20fde4997ad793 - name: github.com/go-xorm/xorm - version: 311abf25abd146a5ddaad5dc3241eba4b4b29284 + version: 3ad0b428ae702d7d3f880c90a7f6d89805fcd2f7 - name: github.com/gogits/chardet version: 2404f777256163ea3eadb273dada5dcb037993c0 - name: github.com/gogits/cron diff --git a/gogs.go b/gogs.go index e196b0f83..f6a5d52f9 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.101.1220" +const APP_VER = "0.9.102.1220" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/models.go b/models/models.go index 0cf422a9a..19c4c29e5 100644 --- a/models/models.go +++ b/models/models.go @@ -34,6 +34,7 @@ type Engine interface { InsertOne(interface{}) (int64, error) Iterate(interface{}, xorm.IterFunc) error Sql(string, ...interface{}) *xorm.Session + Table(interface{}) *xorm.Session Where(interface{}, ...interface{}) *xorm.Session } diff --git a/models/org.go b/models/org.go index 706b18897..ce6745bd2 100644 --- a/models/org.go +++ b/models/org.go @@ -149,7 +149,7 @@ func CreateOrganization(org, owner *User) (err error) { } if _, err = sess.Insert(&TeamUser{ - Uid: owner.ID, + UID: owner.ID, OrgID: org.ID, TeamID: t.ID, }); err != nil { diff --git a/models/org_team.go b/models/org_team.go index 6a6754cc9..4c285b78d 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -369,7 +369,7 @@ type TeamUser struct { ID int64 `xorm:"pk autoincr"` OrgID int64 `xorm:"INDEX"` TeamID int64 `xorm:"UNIQUE(s)"` - Uid int64 `xorm:"UNIQUE(s)"` + UID int64 `xorm:"UNIQUE(s)"` } func isTeamMember(e Engine, orgID, teamID, uid int64) bool { @@ -390,8 +390,8 @@ func getTeamMembers(e Engine, teamID int64) (_ []*User, err error) { members := make([]*User, 0, len(teamUsers)) for i := range teamUsers { member := new(User) - if _, err = e.Id(teamUsers[i].Uid).Get(member); err != nil { - return nil, fmt.Errorf("get user '%d': %v", teamUsers[i].Uid, err) + if _, err = e.Id(teamUsers[i].UID).Get(member); err != nil { + return nil, fmt.Errorf("get user '%d': %v", teamUsers[i].UID, err) } members = append(members, member) } @@ -457,7 +457,7 @@ func AddTeamMember(orgID, teamID, uid int64) error { } tu := &TeamUser{ - Uid: uid, + UID: uid, OrgID: orgID, TeamID: teamID, } @@ -519,7 +519,7 @@ func removeTeamMember(e Engine, orgID, teamID, uid int64) error { } tu := &TeamUser{ - Uid: uid, + UID: uid, OrgID: orgID, TeamID: teamID, } diff --git a/templates/.VERSION b/templates/.VERSION index f0c439730..176ea887e 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.101.1220 \ No newline at end of file +0.9.102.1220 \ No newline at end of file