remove unnecesary check and fix anon comment (#252)
Cette révision appartient à :
Parent
30d82f77bc
révision
e014164a0a
1 fichiers modifiés avec 1 ajouts et 3 suppressions
|
@ -46,9 +46,7 @@ func PostCommentHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
content := p.Sanitize(r.FormValue("comment"))
|
content := p.Sanitize(r.FormValue("comment"))
|
||||||
|
|
||||||
idNum, err := strconv.Atoi(id)
|
idNum, err := strconv.Atoi(id)
|
||||||
if currentUser.ID <= 0 {
|
|
||||||
http.Error(w, "Invalid user ID", http.StatusInternalServerError)
|
|
||||||
}
|
|
||||||
userID := currentUser.ID
|
userID := currentUser.ID
|
||||||
comment := model.Comment{TorrentID: uint(idNum), UserID: userID, Content: content, CreatedAt: time.Now()}
|
comment := model.Comment{TorrentID: uint(idNum), UserID: userID, Content: content, CreatedAt: time.Now()}
|
||||||
|
|
||||||
|
|
Référencer dans un nouveau ticket