diff --git a/files/classes/user.py b/files/classes/user.py index ac1e6e882..0f46e4078 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -688,6 +688,11 @@ class User(Base): def muting_count(self): return g.db.query(UserMute).filter_by(target_id=self.id).count() + @property + @lazy + def chat_count(self): + return g.db.query(ChatMembership).filter_by(user_id=self.id).count() + @property @lazy def bio_html_eager(self): diff --git a/files/templates/userpage/banner.html b/files/templates/userpage/banner.html index 713019af0..3f6c4f44a 100644 --- a/files/templates/userpage/banner.html +++ b/files/templates/userpage/banner.html @@ -90,9 +90,6 @@ Hates | Voted | Bank Statement - {% if v.admin_level >= PERMS['VIEW_CHATS'] %} - | Chats - {% endif %}