summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-03-16 00:14:26 +0800
committerslene <vslene@gmail.com>2014-03-16 00:14:26 +0800
commitf18c8fc4d98bfb09719d7be0f246934257725142 (patch)
tree33f5c89c7210cbe3e47e240ceaa1100451c5647b /modules
parent7ca830677525e6fc9127660fde32c46bcf00ab59 (diff)
downloadgitea-f18c8fc4d98bfb09719d7be0f246934257725142.tar.gz
gitea-f18c8fc4d98bfb09719d7be0f246934257725142.zip
add Owner to Context.Repo
Diffstat (limited to 'modules')
-rw-r--r--modules/middleware/context.go1
-rw-r--r--modules/middleware/repo.go2
2 files changed, 3 insertions, 0 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 42ef1320cb..d002d3c24e 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -34,6 +34,7 @@ type Context struct {
IsValid bool
IsOwner bool
Repository *models.Repository
+ Owner *models.User
}
}
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index fcf1f07b98..948713efe8 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -51,6 +51,8 @@ func RepoAssignment(redirect bool) martini.Handler {
return
}
+ ctx.Repo.Owner = user
+
// get repository
repo, err := models.GetRepositoryByName(user, params["reponame"])
if err != nil {