From 16ad046162e73b8d4c57c5a228ee06b33f10783b Mon Sep 17 00:00:00 2001 From: ayame-git Date: Thu, 4 May 2017 15:51:16 +0300 Subject: [PATCH] fixed getTorrentById --- models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.go b/models.go index b366f21d..4735d830 100644 --- a/models.go +++ b/models.go @@ -82,7 +82,7 @@ type HomeTemplateVariables struct { func getTorrentById(id string) (Torrents, error) { var torrent Torrents - if db.Order("torrent_id DESC").First(&torrent, "id = ?", html.EscapeString(id)).RecordNotFound() { + if db.Where("torrent_id = ?", id).Find(&torrent).RecordNotFound() { return torrent, errors.New("Article is not found.") }