1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-09 12:07:20 +00:00

Fix delete nonexist oauth application 500 and prevent deadlock (#15384) (#15396)

* Fix delete nonexist oauth application 500

* Fix test

* Close the session

* Fix more missed sess.Close

* Remove unnecessary blank line

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Lunny Xiao
2021-04-11 10:57:44 +08:00
committed by GitHub
parent 1fe5fe419e
commit 87074ec860
4 changed files with 13 additions and 2 deletions

View File

@ -92,6 +92,10 @@ func testAPIDeleteOAuth2Application(t *testing.T) {
session.MakeRequest(t, req, http.StatusNoContent)
models.AssertNotExistsBean(t, &models.OAuth2Application{UID: oldApp.UID, Name: oldApp.Name})
// Delete again will return not found
req = NewRequest(t, "DELETE", urlStr)
session.MakeRequest(t, req, http.StatusNotFound)
}
func testAPIGetOAuth2Application(t *testing.T) {