From: jordan Date: Sun, 27 Mar 2011 16:25:04 +0000 (+0000) Subject: Changing the statement that checks if the content has to be deleted/hidden. We should... X-Git-Tag: live~396 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/63c09245e8d317fa7618d1dae0fda1985e75c064 Changing the statement that checks if the content has to be deleted/hidden. We should use >= instead of ==. Let's imagine that firstly the admin configured OSQA to delete Answers that have been flagged 10 times, the answer has been flagged 8 times and then the admin changes that setting to 5 times. What happens with the answer that has been flagged 8 times? It will never be automatically deleted by the system. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@900 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/actions/meta.py b/forum/actions/meta.py index f5c12cd..a964ef1 100644 --- a/forum/actions/meta.py +++ b/forum/actions/meta.py @@ -97,10 +97,10 @@ class FlagAction(ActionProxy): flag.save() self.node.reset_flag_count_cache() - if self.node.flag_count == int(settings.FLAG_COUNT_TO_HIDE_POST): + if self.node.flag_count >= int(settings.FLAG_COUNT_TO_HIDE_POST): self.repute(self.node.author, -int(settings.REP_LOST_BY_FLAGGED_3_TIMES)) - if self.node.flag_count == int(settings.FLAG_COUNT_TO_DELETE_POST): + if self.node.flag_count >= int(settings.FLAG_COUNT_TO_DELETE_POST): self.repute(self.node.author, -int(settings.REP_LOST_BY_FLAGGED_5_TIMES)) if not self.node.nis.deleted: DeleteAction(node=self.node, user=self.user, extra="BYFLAGGED").save()