Fixing bug that doesn't allow attachments to be created. Fixes #151

pull/157/head
Jordan Wright 2016-02-15 11:58:14 -06:00
parent 3d9e447992
commit 1fe1af2ce9
1 changed files with 1 additions and 0 deletions

View File

@ -82,6 +82,7 @@ func GetTemplateByName(n string, uid int64) (Template, error) {
err := db.Where("user_id=? and name=?", uid, n).Find(&t).Error
if err != nil {
Logger.Println(err)
return t, err
}
err = db.Where("template_id=?", t.Id).Find(&t.Attachments).Error
if err != nil && err != gorm.RecordNotFound {