Change statuscode to 202

This commit is contained in:
Matthias
2023-05-22 19:43:27 +02:00
parent 756e1f5d5b
commit 33e25434b4
2 changed files with 2 additions and 2 deletions

View File

@@ -371,7 +371,7 @@ def pairlists_evaluate(payload: PairListsPayload, background_tasks: BackgroundTa
@router.get('/pairlists/evaluate', response_model=WhitelistResponse, tags=['pairlists'])
def pairlists_evaluate_get():
if ApiBG.pairlist_running:
raise HTTPException(status_code=400, detail='Pairlist evaluation is currently running.')
raise HTTPException(status_code=202, detail='Pairlist evaluation is currently running.')
if not ApiBG.pairlist_result:
raise HTTPException(status_code=400, detail='Pairlist evaluation not started yet.')

View File

@@ -1650,7 +1650,7 @@ def test_api_pairlists_evaluate(botclient, tmpdir):
ApiBG.pairlist_running = True
rc = client_get(client, f"{BASE_URI}/pairlists/evaluate")
assert_response(rc, 400)
assert_response(rc, 202)
assert rc.json()['detail'] == 'Pairlist evaluation is currently running.'
body = {