master
Evan Chen 2022-01-25 23:33:48 +08:00
parent 1abe1c7476
commit c72c40fcd3
4 changed files with 8 additions and 7 deletions

View File

@ -46,7 +46,7 @@ func (u *User) BeforeCreate(tx *gorm.DB) (err error) {
if u.ID == "" { if u.ID == "" {
u.ID = xid.New().String() u.ID = xid.New().String()
} }
u.Activated = true // u.Activated = true
u.LastLogin = time.Now() u.LastLogin = time.Now()
u.LoginFailed = 0 u.LoginFailed = 0
return return

View File

@ -47,8 +47,6 @@ func (c *Calendar) BeforeSave(tx *gorm.DB) (err error) {
return errors.ErrorNotFound return errors.ErrorNotFound
} }
c.GroupID = grp_id c.GroupID = grp_id
} else {
c.GroupID = 0
} }
return return
} }

View File

@ -45,8 +45,6 @@ func (eg *EventGroup) BeforeSave(tx *gorm.DB) (err error) {
return errors.ErrorNotFound return errors.ErrorNotFound
} }
eg.GroupID = grp_id eg.GroupID = grp_id
} else {
eg.GroupID = 0
} }
return return

View File

@ -2,6 +2,8 @@ package email
import ( import (
"testing" "testing"
"gopkg.in/gomail.v2"
) )
func TestSendSimple(t *testing.T) { func TestSendSimple(t *testing.T) {
@ -72,8 +74,11 @@ func TestSend(t *testing.T) {
} }
func TestMaintain(t *testing.T) { func TestMaintain(t *testing.T) {
setupDefault() setupDefault()
err := Send("test@kumoly.io", // dial = &gomail.Dialer{Host: "localhost", Port: 25, SSL: false}
[]string{"test@kumoly.io"}, "TestMaintain", dial = gomail.NewDialer("smtp.gmail.com", 587, "rd.trac@arec.com", "hlllzqcfsedrqeul")
err := Send("rd.trac@arec.com",
[]string{"evanchen333@gmail.com"}, "TestMaintain",
&Body{ &Body{
Greeting: "您好", Greeting: "您好",
Receiver: "管理員", Receiver: "管理員",