From 625f4f8dc0ad35b55d01fe2de423412c87dd3785 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Thu, 3 Mar 2016 18:47:10 -0600 Subject: [PATCH] Ignoring error for no sending profile found. Fixes #189 --- models/campaign.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/models/campaign.go b/models/campaign.go index 827d0d02..6adf33d0 100644 --- a/models/campaign.go +++ b/models/campaign.go @@ -144,9 +144,9 @@ func GetCampaigns(uid int64) ([]Campaign, error) { Logger.Println(err) } err = db.Table("SMTP").Where("id=?", cs[i].SMTPId).Find(&cs[i].SMTP).Error - if err != nil { - Logger.Println(err) - } + if err != nil { + Logger.Println(err) + } } return cs, err } @@ -180,7 +180,10 @@ func GetCampaign(id int64, uid int64) (Campaign, error) { } err = db.Table("SMTP").Where("id=?", c.SMTPId).Find(&c.SMTP).Error if err != nil { + // For now, since we just introduced the new sending profiles + // we'll return nil for the error Logger.Printf("%s: sending profile not found for campaign\n", err) + err = nil } return c, err }