move testing to just alerts

This commit is contained in:
Your Name 2024-01-10 14:35:09 -05:00
parent 7214e0a73f
commit b79e38a5f9
2 changed files with 5 additions and 4 deletions

View File

@ -158,6 +158,9 @@ func SendMail(addr, from, subject, body string, to string) error {
//
func SendAlert(u int64, subject, body string) error {
if c.Testing {
return nil
}
user, ok := GetById(u)
if !ok {
return fmt.Errorf("scsusers.SendAlert: User %d not found", u)

View File

@ -96,9 +96,7 @@ func Register(username, email, ip string) bool {
log.Printf("scsusers.Register: insert failed: %s\n", err.Error())
return false
}
if c.Testing {
return true
}
if SendRegistrationEmail(email, username, string(pass)) {
log.Printf("scsusers.Register: New user registration: %s from %s\n", username, ip)
return true