Browse Source

add Owner to Context.Repo

pull/31/head
slene 11 years ago
parent
commit
f18c8fc4d9
  1. 1
      modules/middleware/context.go
  2. 2
      modules/middleware/repo.go

1
modules/middleware/context.go

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

2
modules/middleware/repo.go

@ -51,6 +51,8 @@ func RepoAssignment(redirect bool) martini.Handler {
return return
} }
ctx.Repo.Owner = user
// get repository // get repository
repo, err := models.GetRepositoryByName(user, params["reponame"]) repo, err := models.GetRepositoryByName(user, params["reponame"])
if err != nil { if err != nil {

Loading…
Cancel
Save