Fixed bug with creating new tag in qbit initially (wasn't passing the cookie to the post function)

This commit is contained in:
Benjamin Harder
2023-10-03 20:02:59 +02:00
parent 1b704dc211
commit 44098741e4

View File

@@ -38,10 +38,10 @@ async def rest_delete(url, api_key, params=None):
return None
# POST
async def rest_post(url, data, headers):
async def rest_post(url, data, headers, cookies=None):
if settings_dict['TEST_RUN']: return
try:
response = await asyncio.get_event_loop().run_in_executor(None, lambda: requests.post(url, data=data, headers=headers))
response = await asyncio.get_event_loop().run_in_executor(None, lambda: requests.post(url, data=data, headers=headers, cookies=cookies))
response.raise_for_status()
if response.status_code in (200,201):
return None