typos, gitignore for intelij

This commit is contained in:
Dan Ballard 2015-09-05 10:49:29 -07:00
parent f9ab27e32a
commit 8f9969b4cc
3 changed files with 11 additions and 4 deletions

2
.gitignore vendored
View File

@ -3,6 +3,8 @@ transmet
db/dbconf.yml
.Rhistory
.project
*.iml
.idea
*~
*.o
*.a

View File

@ -42,6 +42,11 @@ func (news *News) Insert(db *sql.DB) error {
return nil
}
func Delete(db *sql.DB, id int) error {
return nil
}
func nullStringToString(str *sql.NullString) string {
if str.Valid {
return str.String

View File

@ -242,16 +242,16 @@ func deleteHandler(w http.ResponseWriter, r *http.Request, user *user.User, sess
if idErr != nil {
session.AddFlash("Invalid news to delete", flash_err)
} else {
err := categories.Delete(db, id)
err := news.Delete(db, id)
if err != nil {
session.AddFlash("Error commiting to Database", flash_err)
} else {
session.AddFlash("Deleted category", flash_info)
session.AddFlash("Deleted news post", flash_info)
}
}
session.Save(r, w)
http.Redirect(w, r, "/categories", http.StatusFound)
http.Redirect(w, r, "/", http.StatusFound)
}
@ -381,7 +381,7 @@ func init_route_handlers() {
r.HandleFunc("/export", userHandler(templateFormHandler))
r.HandleFunc("/export-commit", userHandler(exportHandler))
r.HandleFunc("/added", userHandler(addedHandler))
r.handleFunc("/delete", userHandler(deleteHandler))
r.HandleFunc("/delete", userHandler(deleteHandler))
r.HandleFunc("/categories", getPostHandler(userHandler(categoriesFormHandler), userHandler(categoriesPostHandler)))
r.HandleFunc("/categories/change-parent", userHandler(categoryChangeParentHandler))