From 440413c34b84d70fe17c8db35bd9e1e79bf9f55b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 27 Jul 2021 02:16:30 +0200 Subject: [PATCH] fdfd --- drama/classes/comment.py | 4 ++++ drama/classes/submission.py | 5 +++++ drama/templates/comments.html | 2 +- drama/templates/submission.html | 2 +- drama/templates/submission_listing.html | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drama/classes/comment.py b/drama/classes/comment.py index 8ccdf65d5..6ac863950 100644 --- a/drama/classes/comment.py +++ b/drama/classes/comment.py @@ -297,6 +297,10 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing): def is_op(self): return self.author_id==self.post.author_id + @property + @lazy + def active_flags(self): + return len(self.flags) diff --git a/drama/classes/submission.py b/drama/classes/submission.py index cdc94590e..add9e5fc8 100644 --- a/drama/classes/submission.py +++ b/drama/classes/submission.py @@ -413,6 +413,11 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): if self.url: return self.url.endswith('jpg') or self.url.endswith('png') or self.url.endswith('.gif') or self.url.endswith('jpeg') or self.url.endswith('?maxwidth=9999') or self.url.endswith('?maxwidth=8888') else: return False + @property + @lazy + def active_flags(self): + return len(self.flags) + class SaveRelationship(Base, Stndrd): diff --git a/drama/templates/comments.html b/drama/templates/comments.html index 6f297da21..5b4b560bb 100644 --- a/drama/templates/comments.html +++ b/drama/templates/comments.html @@ -114,7 +114,7 @@
{% if c.banaward %}  {% endif %} - {% if c.flags %} {{c.flags.count()}} Reports {% endif %} + {% if c.flags %} {{c.active_flags}} Reports {% endif %} {% if c.over_18 %}+18 {% endif %} {% if v and v.admin_level==6 and c.author.shadowbanned %} {% endif %} {% if c.is_pinned %} {% endif %} diff --git a/drama/templates/submission.html b/drama/templates/submission.html index 38409cbdf..a5b065202 100644 --- a/drama/templates/submission.html +++ b/drama/templates/submission.html @@ -216,7 +216,7 @@ {% if p.over_18 %}+18{% endif %} {% if p.private %}unlisted{% endif %} {% if p.repost_id %}repost{% endif %} - {% if p.flags %}{{p.flags.count()}} Reports{% endif %} + {% if p.flags %}{{p.active_flags}} Reports{% endif %}    {{p.author.username}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %}  {{p.age_string}} ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) diff --git a/drama/templates/submission_listing.html b/drama/templates/submission_listing.html index ef63fdf59..07c3b7da3 100644 --- a/drama/templates/submission_listing.html +++ b/drama/templates/submission_listing.html @@ -136,7 +136,7 @@ {% if p.is_blocked %}{% endif %} {% if p.private %}unlisted{% endif %} {% if p.repost_id %} repost{% endif %} - {% if p.flags %}{{p.flags.count()}} Reports{% endif %} + {% if p.flags %}{{p.active_flags}} Reports{% endif %}  {{p.author.username}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %}  {{p.age_string}}