You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_GatheringFuture exception was never retrieved
future: <_GatheringFuture finished exception=RuntimeError('The transaction must run within a task')>
Traceback (most recent call last):
File "C:\Users\User\Desktop\git\microservice-users\routes\roles.py", line 160, in m
async with objects.atomic():
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\peewee_async.py", line 1273, in __aenter__
return (await self._ctx.__aenter__())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\peewee_async.py", line 1202, in __aenter__
raise RuntimeError("The transaction must run within a task")
RuntimeError: The transaction must run within a task
@router.patch("/roles")
@get_scopes('manage_roles')
async def role_patch(request: Request):
/// other code
async def m():
async with objects.atomic():
for change in data_json:
role_id = change.get("role_id")
position = change.get("position")
if role_id not in jpath.search("*.role_id", roles):
raise HTTPException(400, "The role you have in JSON was not found")
if position not in range(1, len(roles)+1):
raise HTTPException(400, "Invalid positon role")
role = await get_role(str(role_id))
role.priority = 7 # value for example
await objects.update(role)
task = asyncio.create_task(m())
asyncio.gather(task)
The text was updated successfully, but these errors were encountered:
Hi @rudyryk It is already released as beta and i use the version in my projects. I am going to make a prod-release version after the beta has been in production for a while
The text was updated successfully, but these errors were encountered: