From e4dd06e628d2d059d55216bd1c4df6f9917060c3 Mon Sep 17 00:00:00 2001 From: extreme4all <> Date: Wed, 24 Apr 2024 00:04:17 +0200 Subject: [PATCH 1/2] bug fix --- src/api/v1/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/v1/report.py b/src/api/v1/report.py index 4178a4e..f9c1469 100644 --- a/src/api/v1/report.py +++ b/src/api/v1/report.py @@ -219,7 +219,7 @@ async def insert_active_reporter(reporter: str): async def insert_report_v2(detections: list[detection]): try: url = 'https://api.prd.osrsbotdetector.com/v2/report' - data = [d.model_dump() for d in detections] + data = [d.dict() for d in detections] async with aiohttp.ClientSession() as session: async with session.post(url=url,data=data) as response: if not response.ok: From 5aa6c04ad5ffd09b68644edcbf33b18fd881ec98 Mon Sep 17 00:00:00 2001 From: extreme4all <> Date: Wed, 24 Apr 2024 00:10:59 +0200 Subject: [PATCH 2/2] bug fix --- src/api/v1/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/v1/report.py b/src/api/v1/report.py index f9c1469..e3f82c1 100644 --- a/src/api/v1/report.py +++ b/src/api/v1/report.py @@ -221,7 +221,7 @@ async def insert_report_v2(detections: list[detection]): url = 'https://api.prd.osrsbotdetector.com/v2/report' data = [d.dict() for d in detections] async with aiohttp.ClientSession() as session: - async with session.post(url=url,data=data) as response: + async with session.post(url=url, json=data) as response: if not response.ok: logger.error(await response.text()) except Exception as e: