From 2d177ed1d828860fb2b1e9a932b00a9013876d67 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 3 Apr 2022 20:01:11 +0200 Subject: [PATCH] spaghetti --- files/classes/user.py | 5 +++++ files/templates/header.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index eea6e0790b..c4c07a224d 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -418,6 +418,11 @@ class User(Base): def post_notifications_count(self): return g.db.query(Notification.user_id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.author_id == AUTOJANNY_ID).count() + @property + @lazy + def reddit_notifications_count(self): + return g.db.query(Notification.user_id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.author_id == AUTOJANNY_ID, Comment.body_html.like('

New rdrama mention: {{v.notifications_count}} + {{v.notifications_count}} {% else %} {% endif %} @@ -102,7 +102,7 @@ {% if v.notifications_count %}

{% else %}