From ac4a10456ea4515091c3c90a83a82c1e59cdf428 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 12 Dec 2014 20:30:32 -0500 Subject: api: able to create repo and fix #726 - POST /user/repos - POST /org/:org/repos --- routers/repo/repo.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'routers/repo/repo.go') diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 8e4ace99..70b0c05e 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -97,14 +97,14 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) { if ctxUser.IsOrganization() { // Check ownership of organization. - if !ctxUser.IsOrgOwner(ctx.User.Id) { + if !ctxUser.IsOwnedBy(ctx.User.Id) { ctx.Error(403) return } } repo, err := models.CreateRepository(ctxUser, form.RepoName, form.Description, - form.Gitignore, form.License, form.Private, false, form.InitReadme) + form.Gitignore, form.License, form.Private, false, form.AutoInit) if err == nil { log.Trace("Repository created: %s/%s", ctxUser.Name, repo.Name) ctx.Redirect(setting.AppSubUrl + "/" + ctxUser.Name + "/" + repo.Name) @@ -174,7 +174,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { if ctxUser.IsOrganization() { // Check ownership of organization. - if !ctxUser.IsOrgOwner(ctx.User.Id) { + if !ctxUser.IsOwnedBy(ctx.User.Id) { ctx.Error(403) return } @@ -292,7 +292,7 @@ func ForkPost(ctx *middleware.Context, form auth.CreateRepoForm) { if ctxUser.IsOrganization() { // Check ownership of organization. - if !ctxUser.IsOrgOwner(ctx.User.Id) { + if !ctxUser.IsOwnedBy(ctx.User.Id) { ctx.Error(403) return } -- cgit v1.2.3