diff --git a/files/classes/user.py b/files/classes/user.py index 47907e590f..ec46559738 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -13,6 +13,7 @@ from flask import g, session, request from files.classes import Base from files.classes.casino_game import CasinoGame +from files.classes.group import GroupMembership from files.classes.sub import Sub from files.helpers.config.const import * from files.helpers.config.modaction_types import * @@ -812,6 +813,11 @@ class User(Base): def moderated_subs(self): return [x[0] for x in g.db.query(Mod.sub).filter_by(user_id=self.id).all()] + @property + @lazy + def ping_groups(self): + return [x[0] for x in g.db.query(GroupMembership.group_name).filter_by(user_id=self.id).all()] + @lazy def has_follower(self, user): if not user or self.id == user.id: return False # users can't follow themselves diff --git a/files/templates/userpage/banner.html b/files/templates/userpage/banner.html index f36c6352c9..c89f8e96ef 100644 --- a/files/templates/userpage/banner.html +++ b/files/templates/userpage/banner.html @@ -131,9 +131,20 @@ {% if u.moderated_subs %}
Moderator of
- {% for a in u.moderated_subs %} + {% for i in u.moderated_subs %} - /h/{{a}} + /h/{{i}} + + {% endfor %} +Member of
+ {% for i in u.ping_groups %} + + !{{i}} {% endfor %}Moderator of
- {% for a in u.moderated_subs %} + {% for i in u.moderated_subs %} - /h/{{a}} + /h/{{i}} + + {% endfor %} +Member of
+ {% for i in u.ping_groups %} + + !{{i}} {% endfor %}