You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/10/26 22:29:56 UTC

[allura] branch db/skip_some_spam_checks created (now 80d82e3)

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a change to branch db/skip_some_spam_checks
in repository https://gitbox.apache.org/repos/asf/allura.git.


      at 80d82e3  Skip spam checks on metadata comments (ticket diff) and imported comments (often ip/ua/referrer/author info is not available)

This branch includes the following new commits:

     new 80d82e3  Skip spam checks on metadata comments (ticket diff) and imported comments (often ip/ua/referrer/author info is not available)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[allura] 01/01: Skip spam checks on metadata comments (ticket diff) and imported comments (often ip/ua/referrer/author info is not available)

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/skip_some_spam_checks
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 80d82e3ee19c437c512247b49e9993e23d5c6de6
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Oct 26 18:18:47 2020 -0400

    Skip spam checks on metadata comments (ticket diff) and imported comments (often ip/ua/referrer/author info is not available)
---
 Allura/allura/model/discuss.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 7658578..1c2f513 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -331,11 +331,14 @@ class Thread(Artifact, ActivityObject):
             kwargs['_id'] = message_id
         post = self.post_class()(**kwargs)
 
+        if ignore_security or is_meta:
+            spammy = False
+        else:
+            spammy = self.is_spam(post)
         # unmoderated post -> autoapprove
         # unmoderated post but is spammy -> don't approve it, it goes into moderation
         # moderated post -> moderation
         # moderated post but is spammy -> mark as spam
-        spammy = self.is_spam(post)
         if ignore_security or (not spammy and has_access(self, 'unmoderated_post')):
             log.info('Auto-approving message from %s', c.user.username)
             file_info = kw.get('file_info', None)