diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-04-17 10:14:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 10:14:18 +0800 |
commit | fa497b16332c24bc4d9e788c64bda94e3c1499a7 (patch) | |
tree | 1dcf1b13f702a07dc30da791bf0e76e1ffba4027 /internal/route/api/v1/admin/user.go | |
parent | e131a4564680a3257a2d4795af7669e4260b33b9 (diff) |
db: add tests for repos (#6112)
* Add Repos.create method
* Fix repo name error handling
* Fix all compile errors
* Update github.com/go-macaron/captcha to fix http issue
* Add repos tests
Diffstat (limited to 'internal/route/api/v1/admin/user.go')
-rw-r--r-- | internal/route/api/v1/admin/user.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/route/api/v1/admin/user.go b/internal/route/api/v1/admin/user.go index 0593475a..e5d42a92 100644 --- a/internal/route/api/v1/admin/user.go +++ b/internal/route/api/v1/admin/user.go @@ -55,8 +55,7 @@ func CreateUser(c *context.APIContext, form api.CreateUserOption) { if err := db.CreateUser(u); err != nil { if db.IsErrUserAlreadyExist(err) || db.IsErrEmailAlreadyUsed(err) || - db.IsErrNameReserved(err) || - db.IsErrNamePatternNotAllowed(err) { + db.IsErrNameNotAllowed(err) { c.ErrorStatus(http.StatusUnprocessableEntity, err) } else { c.Error(err, "create user") |