fixed Origin.delete()

This commit is contained in:
Oscar Krause 2023-01-23 07:19:18 +01:00
parent 64327c3a64
commit 77dd0922d8

View File

@ -198,7 +198,7 @@ async def _origins_delete(request: Request):
@app.delete('/-/origins/{origin_ref}', summary='* Origins') @app.delete('/-/origins/{origin_ref}', summary='* Origins')
async def _origins_delete_origin_ref(request: Request, origin_ref: str): async def _origins_delete_origin_ref(request: Request, origin_ref: str):
if Origin.delete(db, origin_ref) == 1: if Origin.delete(db, [origin_ref]) == 1:
return Response(status_code=201) return Response(status_code=201)
raise JSONResponse(status_code=404, content={'status': 404, 'detail': 'lease not found'}) raise JSONResponse(status_code=404, content={'status': 404, 'detail': 'lease not found'})