update
parent
1abe1c7476
commit
c72c40fcd3
|
@ -46,7 +46,7 @@ func (u *User) BeforeCreate(tx *gorm.DB) (err error) {
|
|||
if u.ID == "" {
|
||||
u.ID = xid.New().String()
|
||||
}
|
||||
u.Activated = true
|
||||
// u.Activated = true
|
||||
u.LastLogin = time.Now()
|
||||
u.LoginFailed = 0
|
||||
return
|
||||
|
|
|
@ -47,8 +47,6 @@ func (c *Calendar) BeforeSave(tx *gorm.DB) (err error) {
|
|||
return errors.ErrorNotFound
|
||||
}
|
||||
c.GroupID = grp_id
|
||||
} else {
|
||||
c.GroupID = 0
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -45,8 +45,6 @@ func (eg *EventGroup) BeforeSave(tx *gorm.DB) (err error) {
|
|||
return errors.ErrorNotFound
|
||||
}
|
||||
eg.GroupID = grp_id
|
||||
} else {
|
||||
eg.GroupID = 0
|
||||
}
|
||||
|
||||
return
|
||||
|
|
|
@ -2,6 +2,8 @@ package email
|
|||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gopkg.in/gomail.v2"
|
||||
)
|
||||
|
||||
func TestSendSimple(t *testing.T) {
|
||||
|
@ -72,8 +74,11 @@ func TestSend(t *testing.T) {
|
|||
}
|
||||
func TestMaintain(t *testing.T) {
|
||||
setupDefault()
|
||||
err := Send("test@kumoly.io",
|
||||
[]string{"test@kumoly.io"}, "TestMaintain",
|
||||
// dial = &gomail.Dialer{Host: "localhost", Port: 25, SSL: false}
|
||||
dial = gomail.NewDialer("smtp.gmail.com", 587, "rd.trac@arec.com", "hlllzqcfsedrqeul")
|
||||
|
||||
err := Send("rd.trac@arec.com",
|
||||
[]string{"evanchen333@gmail.com"}, "TestMaintain",
|
||||
&Body{
|
||||
Greeting: "您好",
|
||||
Receiver: "管理員",
|
||||
|
|
Loading…
Reference in New Issue