debug-create-reaction
All checks were successful
Deploy on push / deploy (push) Successful in 5s

This commit is contained in:
Untone 2024-11-02 13:44:00 +03:00
parent 3f1ef8dfd8
commit 52567557e8

View File

@ -214,7 +214,7 @@ async def _create_reaction(session, info, shout_dict, author_id: int, reaction)
is_author = bool(list(filter(lambda x: x['id'] == int(author_id), [x for x in shout_dict['authors']]))) is_author = bool(list(filter(lambda x: x['id'] == int(author_id), [x for x in shout_dict['authors']])))
if r.reply_to and r.kind in PROPOSAL_REACTIONS and is_author: if r.reply_to and r.kind in PROPOSAL_REACTIONS and is_author:
handle_proposing(r.kind, r.reply_to, shout_dict['id']) handle_proposing(r.kind, r.reply_to, shout_dict['id'])
# Handle rating # Handle rating
if r.kind in RATING_REACTIONS: if r.kind in RATING_REACTIONS:
if check_to_unfeature(session, author_id, r): if check_to_unfeature(session, author_id, r):
@ -322,6 +322,8 @@ async def create_reaction(_, info, reaction):
logger.error(f"Shout not found with ID: {shout_id}") logger.error(f"Shout not found with ID: {shout_id}")
return {"error": "Shout not found"} return {"error": "Shout not found"}
except Exception as e: except Exception as e:
import traceback
traceback.print_exc()
logger.error(f"{type(e).__name__}: {e}") logger.error(f"{type(e).__name__}: {e}")
return {"error": "Cannot create reaction."} return {"error": "Cannot create reaction."}