diff --git a/files/classes/user.py b/files/classes/user.py index 16577ed30..3a9794a6d 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -548,6 +548,16 @@ class User(Base): posts = g.db.query(Subscription.submission_id).filter_by(user_id=self.id).all() return [x[0] for x in posts] + @property + @lazy + def saved_count(self): + return g.db.query(SaveRelationship.submission_id).filter(SaveRelationship.user_id == self.id).count() + + @property + @lazy + def saved_comment_count(self): + return g.db.query(SaveRelationship.comment_id).filter(SaveRelationship.user_id == self.id).count() + @lazy def saved_idlist(self, page=1): diff --git a/files/templates/userpage.html b/files/templates/userpage.html index f18853eb6..5791e4051 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -609,10 +609,10 @@ {% if u.id == v.id %} {% endif %} diff --git a/files/templates/userpage_comments.html b/files/templates/userpage_comments.html index 7079f3b8f..d04145f14 100644 --- a/files/templates/userpage_comments.html +++ b/files/templates/userpage_comments.html @@ -14,10 +14,10 @@ {% if u.id == v.id %} {% endif %}