This commit is contained in:
parent
33ddfc6c31
commit
84de0c5538
2
cache/triggers.py
vendored
2
cache/triggers.py
vendored
|
@ -77,7 +77,7 @@ def after_reaction_handler(mapper, connection, target):
|
|||
|
||||
# Обновляем счетчики для автора комментария
|
||||
if target.created_by:
|
||||
revalidation_manager.mark_for_revalidation(target.created_by.id, "authors")
|
||||
revalidation_manager.mark_for_revalidation(target.created_by, "authors")
|
||||
|
||||
# Обновляем счетчики для поста и его авторов/тем
|
||||
revalidation_manager.mark_for_revalidation(shout.id, "shouts")
|
||||
|
|
|
@ -281,8 +281,10 @@ async def create_reaction(_, info, reaction):
|
|||
logger.debug(f"Creating reaction with data: {reaction_input}")
|
||||
logger.debug(f"Author ID: {author_id}, Shout ID: {shout_id}")
|
||||
|
||||
if not shout_id or not author_id:
|
||||
return {"error": "Shout ID and author ID are required to create a reaction."}
|
||||
if not author_id:
|
||||
return {"error": "Author ID is required to create a reaction."}
|
||||
if not shout_id:
|
||||
return {"error": "Shout ID is required to create a reaction."}
|
||||
|
||||
try:
|
||||
with local_session() as session:
|
||||
|
|
Loading…
Reference in New Issue
Block a user