diff --git a/pkg/notify/dispatcher.go b/pkg/notify/dispatcher.go index 66817ab888..26791ef8f1 100644 --- a/pkg/notify/dispatcher.go +++ b/pkg/notify/dispatcher.go @@ -468,7 +468,7 @@ func (self *NotifyModelDispatcher) UpdateTemplate(ctx context.Context, ctype str q := models.TemplateManager.Query().Equals("contact_type", ctype).In("topic", topics.List()) templateModels := make([]models.STemplate, 0, 1) - err := db.FetchModelObjects(models.ContactManager, q, &templateModels) + err := db.FetchModelObjects(models.TemplateManager, q, &templateModels) if err != nil { log.Errorf("db.FetchModelObjects sql: %s", q.String()) return errors.Wrap(err, "db.FetchModelObjects") diff --git a/pkg/notify/models/mod_template.go b/pkg/notify/models/mod_template.go index 02dc6ef456..ea8894758b 100644 --- a/pkg/notify/models/mod_template.go +++ b/pkg/notify/models/mod_template.go @@ -66,7 +66,7 @@ type STemplate struct { // title | content | remote TemplateType string `width:"10" nullable:"false" create:"required" update:"user" list:"user"` - Content string `length:"text" nullable:"false" create:"required" get:"user" list:"user"` + Content string `length:"text" nullable:"false" create:"required" get:"user" list:"user" update:"user"` } func (tm *STemplateManager) GetEmailUrl() string {