not-fix-2

This commit is contained in:
Untone 2024-01-23 16:40:53 +03:00
parent c17ff75df7
commit 5bcef53138

View File

@ -1,5 +1,5 @@
from sqlalchemy.sql.operators import is_not from sqlalchemy.sql import not_
from services.db import local_session from services.db import local_session
from resolvers.model import ( from resolvers.model import (
NotificationReaction, NotificationReaction,
@ -67,7 +67,7 @@ async def get_notifications_grouped(author_id: int, after: int = 0, limit: int =
and_( and_(
Notification.action == NotificationAction.CREATE.value, Notification.action == NotificationAction.CREATE.value,
Notification.created_at > after, Notification.created_at > after,
~Notification.seen not_(Notification.seen)
) )
).count() ).count()
notifications_result = session.execute(query) notifications_result = session.execute(query)