diff --git a/files/classes/comment.py b/files/classes/comment.py index f4dc8f22a..0c8b45097 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -178,7 +178,7 @@ class Comment(Base): @property @lazy def author_name(self): - if self.ghost: return '👻' + if self.ghost and self.id != g.v.id: return '👻' return self.author.user_name @lazy diff --git a/files/classes/submission.py b/files/classes/submission.py index a59ea1361..ecf384eb0 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -140,7 +140,7 @@ class Submission(Base): @property @lazy def author_name(self): - if self.ghost: return '👻' + if self.ghost and self.id != g.v.id: return '👻' return self.author.user_name @property diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 67d7a64be..b0688062d 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -90,7 +90,7 @@ def notif_comment(text): def notif_comment2(p): - text = f"@{p.author.username} has mentioned you: [{p.title}](/post/{p.id})" + text = f"@{p.author_name} has mentioned you: [{p.title}](/post/{p.id})" search_html = f'% has mentioned you: %' diff --git a/files/routes/awards.py b/files/routes/awards.py index 0bddaf67d..53f770cd6 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -169,10 +169,7 @@ def award_thing(v, thing_type, id): note = request.values.get("note", "").strip() - if thing.ghost and v.id != author.id: - safe_username = "👻" - else: - safe_username = f"@{author.username}" + safe_username = f"@{thing.author_name}" if SITE == 'rdrama.net' and author.id in {PIZZASHILL_ID, CARP_ID}: abort(403, f"{safe_username} is immune to awards!") diff --git a/files/routes/reporting.py b/files/routes/reporting.py index 7f907b120..4580328f0 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -166,7 +166,7 @@ def move_post(post:Submission, v:User, reason:str) -> Union[bool, str]: if v.id == post.author_id: abort(403, f"You need to be a member of House {sub_to.capitalize()} to post in /h/{sub_to}") else: - abort(403, f"@{post.author.username} needs to be a member of House {sub_to.capitalize()} for their post to be moved to /h/{sub_to}") + abort(403, f"@{post.author_name} needs to be a member of House {sub_to.capitalize()} for their post to be moved to /h/{sub_to}") post.sub = sub_to post.hole_pinned = None diff --git a/files/templates/comments.html b/files/templates/comments.html index e58252a77..3f6e9e10e 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -431,9 +431,9 @@ {% endif %} {% if v.id != c.author_id and not c.ghost %} - + - + {% endif %} {% if c.parent_submission %} @@ -610,9 +610,9 @@ {% endif %} {% if not c.ghost %} - + - + {% endif %} {% endif %} diff --git a/files/templates/poll_votes.html b/files/templates/poll_votes.html index 8798da873..cb3ed9ceb 100644 --- a/files/templates/poll_votes.html +++ b/files/templates/poll_votes.html @@ -6,7 +6,7 @@

{{thing.body_html | safe}} - {{ups | length}} {% if thing.exclusive == 2 %}bets{% else %}votes{% endif %}

Link: {{thing.parent.permalink}}

-

Author: @{{thing.parent.author.username}}

+

Author: @{{thing.parent.author_name}}

Author Created At:

Author Truescore: {{"{:,}".format(thing.parent.author.truescore)}}

Total voter truescore: {{total_ts}}

diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index 2cd82bb07..e99ed21ec 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -64,8 +64,8 @@ {% endif %} {% if v.id != p.author_id and not p.ghost %} - - + + {% endif %} {% if v.id != p.author_id and p.sub %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index b97fb50f2..8b43f23de 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -43,8 +43,8 @@ {% else %} {% if not p.ghost %} - - + + {% endif %} {% if p.sub %} diff --git a/files/templates/votes.html b/files/templates/votes.html index b4fdd1a59..f65712759 100644 --- a/files/templates/votes.html +++ b/files/templates/votes.html @@ -4,7 +4,7 @@ {% if thing %}

Info

{{thing.permalink}}

-

Author: @{{thing.author.username}}

+

Author: @{{thing.author_name}}

Author Created At:

Author Truescore: {{"{:,}".format(thing.author.truescore)}}

Upvotes: {{ups | length}}