diff --git a/files/classes/user.py b/files/classes/user.py index 16577ed30e..3a9794a6de 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 f18853eb62..5791e40513 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -609,10 +609,10 @@ {% if u.id == v.id %}