Fix serialisation issue

This commit is contained in:
Daoud Clarke 2022-12-19 23:19:32 +00:00
parent b559a50506
commit 6cf27fa47f

View file

@ -83,18 +83,17 @@ def create_router() -> APIRouter:
@router.post("/curation/begin")
def user_begin_curate(begin_curate: BeginCurate):
body = json.dumps({"original_urls": begin_curate.original_urls}, indent=2)
tokens = tokenize(begin_curate.query)
url = RESULT_URL + "+".join(tokens)
results = begin_curate.dict()["results"]
body = json.dumps({"original_results": results}, indent=2)
create_post = {
"auth": begin_curate.auth,
"body": body,
"community_id": community_id,
"honeypot": None,
"language_id": None,
"name": begin_curate.query,
"name": begin_curate.url,
"nsfw": None,
"url": url,
"url": begin_curate.url,
}
request = requests.post(urljoin(LEMMY_URL, "api/v3/post"), json=create_post)
if request.status_code != 200: