From e014164a0a628a33c858af442853e52b916f00e1 Mon Sep 17 00:00:00 2001 From: Andrew Zhao Date: Tue, 9 May 2017 21:02:03 -0700 Subject: [PATCH] remove unnecesary check and fix anon comment (#252) --- router/viewTorrentHandler.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/router/viewTorrentHandler.go b/router/viewTorrentHandler.go index 56da69d5..b9f12c1c 100644 --- a/router/viewTorrentHandler.go +++ b/router/viewTorrentHandler.go @@ -46,9 +46,7 @@ func PostCommentHandler(w http.ResponseWriter, r *http.Request) { content := p.Sanitize(r.FormValue("comment")) idNum, err := strconv.Atoi(id) - if currentUser.ID <= 0 { - http.Error(w, "Invalid user ID", http.StatusInternalServerError) - } + userID := currentUser.ID comment := model.Comment{TorrentID: uint(idNum), UserID: userID, Content: content, CreatedAt: time.Now()}