From c2db243c050af86b031f4ed08e37f33c54bf04cf Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 27 Apr 2023 20:37:08 +0200 Subject: [PATCH] do this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/4055922#context --- files/classes/submission.py | 5 +++++ files/templates/post_actions.html | 4 ++-- files/templates/post_actions_mobile.html | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index f5e75ea41..87c32a7e6 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -369,3 +369,8 @@ class Submission(Base): @lazy def active_flags(self, v): return len(self.filtered_flags(v)) + + @property + @lazy + def num_subscribers(self): + return g.db.query(Subscription).filter_by(submission_id=self.id).count() diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index 1ebb5bd19..a34bf5870 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -17,8 +17,8 @@ {% if v %} - - + + diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index d50f05d3f..6ceb1767d 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -20,9 +20,9 @@ {%- endif %} - + - +