delete-shout-fix
All checks were successful
Deploy to core / deploy (push) Successful in 1m42s

This commit is contained in:
Untone 2024-01-31 22:47:30 +03:00
parent fbbe6b0751
commit bd5f910f8c

View File

@ -199,7 +199,7 @@ async def update_shout( # noqa: C901
async def delete_shout(_, info, shout_id): async def delete_shout(_, info, shout_id):
user_id = info.context['user_id'] user_id = info.context['user_id']
with local_session() as session: with local_session() as session:
author = session.query(Author).filter(Author.id == user_id).first() author = session.query(Author).filter(Author.user == user_id).first()
shout = session.query(Shout).filter(Shout.id == shout_id).first() shout = session.query(Shout).filter(Shout.id == shout_id).first()
if not shout: if not shout:
return {'error': 'invalid shout id'} return {'error': 'invalid shout id'}