Merge pull request #103 from TheCaringCleaner/ban-links

transform post/comment links in ban reason
This commit is contained in:
Aevann1 2021-11-24 08:02:53 -08:00 committed by GitHub
commit b67a8c4f86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -202,6 +202,12 @@ class User(Base):
def age(self):
return int(time.time()) - self.created_utc
@property
@lazy
def ban_reason_link(self):
if self.ban_reason and (self.ban_reason.startswith("/post/") or self.ban_reason.startswith("/comment/")):
return self.ban_reason.split(" ", 1)[0]
@property
@lazy
def alts_unique(self):