diff options
author | Alec S <linuxbash8@gmail.com> | 2016-03-09 22:56:52 -0600 |
---|---|---|
committer | Alec S <linuxbash8@gmail.com> | 2016-03-09 22:56:52 -0600 |
commit | af847ef94e02dd120246fa1e8d7f7ab999f0cc90 (patch) | |
tree | 82f85bc5c3a7b8fee5b6cdf1f37336c10e73aa24 | |
parent | bfed3ea7d3e0ea07fefa90e60514994beae0cb75 (diff) | |
parent | b44e4d7cb08bb88e2f206101a162662ead29836a (diff) | |
download | gitea-af847ef94e02dd120246fa1e8d7f7ab999f0cc90.tar.gz gitea-af847ef94e02dd120246fa1e8d7f7ab999f0cc90.zip |
Merge branch 'develop' of github.com:gogits/gogs into develop
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | models/org.go | 7 | ||||
-rw-r--r-- | modules/middleware/org.go | 2 | ||||
-rw-r--r-- | routers/user/home.go | 17 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
6 files changed, 20 insertions, 12 deletions
@@ -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 version: 0.9.2 +##### Current version: 0.9.3 | Web | UI | Preview | |:-------------:|:-------:|:-------:| @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.2.0309" +const APP_VER = "0.9.3.0309" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/org.go b/models/org.go index 1fee4f522d..c2665902ad 100644 --- a/models/org.go +++ b/models/org.go @@ -1071,11 +1071,10 @@ WHERE team_user.org_id = ? AND team_user.uid = ?`, org.Id, userID).Find(&teams); } repos := make([]*Repository, 0, 5) - if err = x.Sql(`SELECT repository.* FROM repository + if err = x.Sql(fmt.Sprintf(`SELECT repository.* FROM repository INNER JOIN team_repo ON team_repo.repo_id = repository.id -WHERE (repository.owner_id = ? AND repository.is_private = ?) OR team_repo.team_id IN (?) -GROUP BY repository.id`, - org.Id, false, strings.Join(teamIDs, ",")).Find(&repos); err != nil { +WHERE (repository.owner_id = ? AND repository.is_private = ?) OR team_repo.team_id IN (%s) +GROUP BY repository.id`, strings.Join(teamIDs, ",")), org.Id, false).Find(&repos); err != nil { return fmt.Errorf("get repositories: %v", err) } org.Repos = repos diff --git a/modules/middleware/org.go b/modules/middleware/org.go index e62e0b0b01..eec2b556fd 100644 --- a/modules/middleware/org.go +++ b/modules/middleware/org.go @@ -90,7 +90,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) { if ctx.Org.IsMember { if ctx.Org.IsOwner { if err := org.GetTeams(); err != nil { - ctx.Handle(500, "GetUserTeams", err) + ctx.Handle(500, "GetTeams", err) return } } else { diff --git a/routers/user/home.go b/routers/user/home.go index 3b83529d05..ffebe28489 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -332,11 +332,20 @@ func showOrgProfile(ctx *middleware.Context) { ctx.Data["Title"] = org.FullName if ctx.IsSigned { - if err := org.GetUserRepositories(ctx.User.Id); err != nil { - ctx.Handle(500, "GetUserRepositories", err) - return + if ctx.User.IsAdmin { + repos, err := models.GetRepositories(org.Id, true) + if err != nil { + ctx.Handle(500, "GetRepositoriesAsAdmin", err) + return + } + ctx.Data["Repos"] = repos + } else { + if err := org.GetUserRepositories(ctx.User.Id); err != nil { + ctx.Handle(500, "GetUserRepositories", err) + return + } + ctx.Data["Repos"] = org.Repos } - ctx.Data["Repos"] = org.Repos } else { repos, err := models.GetRepositories(org.Id, false) if err != nil { diff --git a/templates/.VERSION b/templates/.VERSION index f78748364a..572d3528cc 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.2.0309
\ No newline at end of file +0.9.3.0309
\ No newline at end of file |