Don't allow reconfiguring the site

This commit is contained in:
Noah 2017-12-23 18:45:39 -08:00
parent 98dc41aa0a
commit 00925bb267

View File

@ -15,6 +15,13 @@ func (b *Blog) SetupHandler(w http.ResponseWriter, r *http.Request) {
Form: forms.Setup{}, Form: forms.Setup{},
} }
// Reject if we're already set up.
s, _ := settings.Load()
if s.Initialized {
b.FlashAndRedirect(w, r, "/", "This website has already been configured.")
return
}
if r.Method == http.MethodPost { if r.Method == http.MethodPost {
form := forms.Setup{ form := forms.Setup{
Username: r.FormValue("username"), Username: r.FormValue("username"),