diff --git a/files/classes/user.py b/files/classes/user.py index 1cd03df48..d5cc4dae9 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -199,6 +199,15 @@ class User(Base): def age(self): return int(time.time()) - self.created_utc + @property + @lazy + def ban_reason_link(self): + if not self.ban_reason: + return self.ban_reason + + if self.ban_reason.startswith("/post/") or self.ban_reason.startswith("/comment/"): + return self.ban_reason.split(" ", 1)[0] + @property @lazy def alts_unique(self): diff --git a/files/templates/userpage.html b/files/templates/userpage.html index d4f2533a3..184370766 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -122,7 +122,11 @@