Browse Source

Merge pull request 'fix-429' (#525) from fix-333 into V20211018

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/525
Reviewed-by: lewis <747342561@qq.com>
tags/v1.21.12.1
lewis 4 years ago
parent
commit
2fad6e82d4
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      routers/secure/user.go

+ 9
- 0
routers/secure/user.go View File

@@ -7,6 +7,7 @@ package secure

import (
"net/http"
"net/mail"
"strings"

"code.gitea.io/gitea/models"
@@ -63,6 +64,14 @@ func CreateUser(ctx *context.Context, form api.CreateUserOption) {
// "422":
// "$ref": "#/responses/validationError"

_, err1 := mail.ParseAddress(form.Email)
if err1 != nil {
ctx.JSON(http.StatusBadRequest, map[string]string{
"error_msg": "Email format is wrong.",
})
return
}

u := &models.User{
Name: form.Username,
FullName: form.FullName,


Loading…
Cancel
Save