Browse Source

add Owner to Context.Repo

tags/v1.2.0-rc1
slene 11 years ago
parent
commit
f18c8fc4d9
2 changed files with 3 additions and 0 deletions
  1. +1
    -0
      modules/middleware/context.go
  2. +2
    -0
      modules/middleware/repo.go

+ 1
- 0
modules/middleware/context.go View File

@@ -34,6 +34,7 @@ type Context struct {
IsValid bool
IsOwner bool
Repository *models.Repository
Owner *models.User
}
}



+ 2
- 0
modules/middleware/repo.go View File

@@ -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 {


Loading…
Cancel
Save