Fix sending references and bank details

This commit is contained in:
2023-03-10 14:51:34 +00:00
parent 0148525c8b
commit c95d9d7557
8 changed files with 225 additions and 74 deletions

View File

@@ -31,7 +31,8 @@ async def get_refs():
references = []
ref_keys = await r.keys("trade.*.reference")
for key in ref_keys:
references.append(r.get(key))
key_data = await r.get(key)
references.append(key_data)
return convert(references)
@@ -45,7 +46,8 @@ async def tx_to_ref(tx):
"""
refs = await get_refs()
for reference in refs:
ref_data = convert(await r.hgetall(f"trade.{reference}"))
ref_data = await r.hgetall(f"trade.{reference}")
ref_data = convert(ref_data)
if not ref_data:
continue
if ref_data["id"] == tx:
@@ -137,7 +139,8 @@ async def cleanup(subclass, references):
:type references: list
"""
messages = []
for tx, reference in await get_ref_map().items():
ref_map = await get_ref_map()
for tx, reference in ref_map.items():
if reference not in references:
if await get_subclass(reference) == subclass:
logmessage = (

View File

@@ -23,8 +23,7 @@ async def raw_sendmsg(msg, title=None, priority=None, tags=None, url=None, topic
"data": msg,
}
async with aiohttp.ClientSession() as session:
async with session.post(f"{url}/{topic}", **cast) as response:
response = await response.content()
await session.post(f"{url}/{topic}", **cast)
# Sendmsg helper to send a message to a user's notification settings