diff options
author | Zettat123 <zettat123@gmail.com> | 2023-03-13 22:55:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 22:55:30 +0100 |
commit | 8421b8264fd7715ec93b13f37be31a945faec556 (patch) | |
tree | 891fd65121a7361480078c161970a2b597687842 /routers/api/v1/admin | |
parent | Fix missing commit status in PR which from forked repo (#23351) (diff) | |
download | forgejo-8421b8264fd7715ec93b13f37be31a945faec556.tar.xz forgejo-8421b8264fd7715ec93b13f37be31a945faec556.zip |
Handle missing `README` in create repos API (#23387)
Close #22934
In `/user/repos` API (and other APIs related to creating repos), user
can specify a readme template for auto init. At present, if the
specified template does not exist, a `500` will be returned . This PR
improved the logic and will return a `400` instead of `500`.
Diffstat (limited to 'routers/api/v1/admin')
-rw-r--r-- | routers/api/v1/admin/repo.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/api/v1/admin/repo.go b/routers/api/v1/admin/repo.go index 83ed06e49b..a4895f260b 100644 --- a/routers/api/v1/admin/repo.go +++ b/routers/api/v1/admin/repo.go @@ -32,6 +32,8 @@ func CreateRepo(ctx *context.APIContext) { // responses: // "201": // "$ref": "#/responses/Repository" + // "400": + // "$ref": "#/responses/error" // "403": // "$ref": "#/responses/forbidden" // "404": |