From d262ffa1abe829b3a1f4b2e6e78a9bdab79da9c3 Mon Sep 17 00:00:00 2001 From: Scott Ferguson Date: Sun, 9 Feb 2014 20:09:42 -0600 Subject: [PATCH] Show an inline error if the wrong password is given when deleting a repo --- pkg/handler/repos.go | 2 +- pkg/template/pages/repo_delete.html | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/pkg/handler/repos.go b/pkg/handler/repos.go index 99195e10..7c4c87ac 100644 --- a/pkg/handler/repos.go +++ b/pkg/handler/repos.go @@ -274,7 +274,7 @@ func RepoDelete(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) err // the user must confirm their password before deleting password := r.FormValue("password") if err := u.ComparePassword(password); err != nil { - return err + return RenderError(w, err, http.StatusBadRequest) } // delete the repo diff --git a/pkg/template/pages/repo_delete.html b/pkg/template/pages/repo_delete.html index d2ef3722..b36c3707 100644 --- a/pkg/template/pages/repo_delete.html +++ b/pkg/template/pages/repo_delete.html @@ -40,6 +40,7 @@
+
Cancel @@ -51,4 +52,27 @@ {{ end }} {{ define "script" }} -{{ end }} \ No newline at end of file + +{{ end }}