From f63472e6bf07dc8b282cbd26057889f315ea35ff Mon Sep 17 00:00:00 2001 From: freamon Date: Sun, 24 Mar 2024 02:19:49 +0000 Subject: [PATCH] Add mention_tag() function to User class --- app/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models.py b/app/models.py index d22ebb88..642d1348 100644 --- a/app/models.py +++ b/app/models.py @@ -811,6 +811,12 @@ class User(UserMixin, db.Model): reply.body = reply.body_html = '' db.session.commit() + def mention_tag(self): + if self.ap_domain is None: + return '@' + self.user_name + '@' + current_app.config['SERVER_NAME'] + else: + return '@' + self.user_name + '@' + self.ap_domain + class ActivityLog(db.Model): id = db.Column(db.Integer, primary_key=True)