mirror of
https://github.com/gogs/gogs.git
synced 2025-12-21 15:50:00 +01:00
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
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user