mirror of
https://github.com/gogs/gogs.git
synced 2025-12-23 16:50:02 +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:
@@ -31,8 +31,7 @@ func CreateOrgForUser(c *context.APIContext, apiForm api.CreateOrgOption, user *
|
||||
}
|
||||
if err := db.CreateOrganization(org, user); err != nil {
|
||||
if db.IsErrUserAlreadyExist(err) ||
|
||||
db.IsErrNameReserved(err) ||
|
||||
db.IsErrNamePatternNotAllowed(err) {
|
||||
db.IsErrNameNotAllowed(err) {
|
||||
c.ErrorStatus(http.StatusUnprocessableEntity, err)
|
||||
} else {
|
||||
c.Error(err, "create organization")
|
||||
|
||||
Reference in New Issue
Block a user