From 679d91afdfdbe845308b426d780aeb75416dc470 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Tue, 6 Dec 2016 20:17:25 -0200 Subject: [PATCH] Fix SQLs --- models/notification.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/notification.go b/models/notification.go index 44d838fe1..f46f27b12 100644 --- a/models/notification.go +++ b/models/notification.go @@ -86,7 +86,7 @@ func CreateOrUpdateIssueNotifications(issue *Issue) error { defer sess.Close() for _, watch := range watches { - exists, err := issueNotificationExists(sess, watch.UserID, watch.RepoID) + exists, err := issueNotificationExists(sess, watch.UserID, issue.ID) if err != nil { return err } @@ -146,7 +146,7 @@ func updateIssueNotification(e Engine, userID, issueID int64) error { func getIssueNotification(e Engine, userID, issueID int64) (*Notification, error) { notification := new(Notification) _, err := e. - Where("user_id = ?"). + Where("user_id = ?", userID). And("issue_id = ?", issueID). Get(notification) return notification, err