separate-stat-query
All checks were successful
Deploy on push / deploy (push) Successful in 22s

This commit is contained in:
2024-04-23 14:31:34 +03:00
parent 8e130027f0
commit 8436bc4305
12 changed files with 170 additions and 111 deletions

View File

@@ -8,8 +8,12 @@ from sqlalchemy.orm import aliased
from sqlalchemy.sql import not_
from orm.author import Author
from orm.notification import (Notification, NotificationAction,
NotificationEntity, NotificationSeen)
from orm.notification import (
Notification,
NotificationAction,
NotificationEntity,
NotificationSeen,
)
from orm.shout import Shout
from services.auth import login_required
from services.db import local_session
@@ -142,10 +146,10 @@ def get_notifications_grouped(
elif str(notification.entity) == NotificationEntity.REACTION.value:
reaction = payload
if not isinstance(shout, dict):
if not isinstance(reaction, dict):
raise ValueError("reaction data is not consistent")
shout_id = shout.get("shout")
author_id = shout.get("created_by", 0)
shout_id = reaction.get("shout")
author_id = reaction.get("created_by", 0)
if shout_id and author_id:
with local_session() as session:
author = (