diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-13 14:50:32 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-13 14:50:32 +0800 |
commit | 1902500b0dcefa20627129b48c8131da8798c169 (patch) | |
tree | 1a960236b5de97bafaddc76e4bc18830ccc30e3d /routers | |
parent | 3a1fa012f7069c5d6b606a3330ec68abdcc125ed (diff) | |
parent | 27104ac89a4c489809068ae5c6dbe383ce7fbde2 (diff) | |
download | gitea-1902500b0dcefa20627129b48c8131da8798c169.tar.gz gitea-1902500b0dcefa20627129b48c8131da8798c169.zip |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/repo.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 5769aff7c3..a12b45d7b9 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -5,9 +5,9 @@ package repo import ( - "net/http" "github.com/martini-contrib/render" "github.com/martini-contrib/sessions" + "net/http" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" @@ -68,7 +68,7 @@ func Create(form auth.CreateRepoForm, req *http.Request, r render.Render, data b r.HTML(200, "base/error", data) } -func Delete(req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { +func Delete(form auth.DeleteRepoForm, req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { data["Title"] = "Delete repository" if req.Method == "GET" { @@ -76,13 +76,14 @@ func Delete(req *http.Request, r render.Render, data base.TmplData, session sess return } - u := &models.User{} - err := models.DeleteRepository(u, "") - if err != nil { + if err := models.DeleteRepository(form.UserId, form.RepoId, form.UserName); err != nil { data["ErrorMsg"] = err log.Error("repo.Delete: %v", err) r.HTML(200, "base/error", data) + return } + + r.Redirect("/", 200) } func List(req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { |