summaryrefslogtreecommitdiffstats
path: root/services/user/email.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/user/email.go')
-rw-r--r--services/user/email.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/user/email.go b/services/user/email.go
index e8725267f4..31404aadaa 100644
--- a/services/user/email.go
+++ b/services/user/email.go
@@ -12,6 +12,7 @@ import (
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
+ "code.gitea.io/gitea/modules/validation"
"code.gitea.io/gitea/services/mailer"
)
@@ -21,7 +22,7 @@ func AdminAddOrSetPrimaryEmailAddress(ctx context.Context, u *user_model.User, e
return nil
}
- if err := user_model.ValidateEmailForAdmin(emailStr); err != nil {
+ if err := validation.ValidateEmailForAdmin(emailStr); err != nil {
return err
}
@@ -74,7 +75,7 @@ func ReplacePrimaryEmailAddress(ctx context.Context, u *user_model.User, emailSt
return nil
}
- if err := user_model.ValidateEmail(emailStr); err != nil {
+ if err := validation.ValidateEmail(emailStr); err != nil {
return err
}
@@ -119,7 +120,7 @@ func ReplacePrimaryEmailAddress(ctx context.Context, u *user_model.User, emailSt
func AddEmailAddresses(ctx context.Context, u *user_model.User, emails []string) error {
for _, emailStr := range emails {
- if err := user_model.ValidateEmail(emailStr); err != nil {
+ if err := validation.ValidateEmail(emailStr); err != nil {
return err
}