Skip to content

Commit 9f8787f

Browse files
Merge pull request #55 from SuffolkLITLab/spam-filter-additions
Slightly improve spam filtering
2 parents b8ade2b + 9b79f08 commit 9f8787f

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

docassemble/GithubFeedbackForm/alembic/versions/542797f969ea_initial_alembic_migration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2023-10-09 17:06:05.463730
66
77
"""
8+
89
from alembic import op
910
import sqlalchemy as sa
1011

docassemble/GithubFeedbackForm/alembic/versions/8821926028d6_archiving.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2023-10-18 11:45:07.370329
66
77
"""
8+
89
from alembic import op
910
import sqlalchemy as sa
1011
from datetime import datetime

docassemble/GithubFeedbackForm/github_issue.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,24 @@ def feedback_link(
120120
def is_likely_spam(body: Optional[str]) -> bool:
121121
if not body:
122122
return False
123+
body = body.lower()
124+
if any([url in body for url in {"leadgeneration.com", "leadmagnet.com"}]):
125+
return True
123126
if any(
124-
[url in body for url in ["boostleadgeneration.com/", "jumboleadmagnet.com/"]]
127+
[
128+
keyword in body
129+
for keyword in {
130+
"free trial",
131+
"unsubscribe",
132+
"web visitors into leads",
133+
"international long distance calling",
134+
"100 times more effective",
135+
"web visitors",
136+
"lead feature",
137+
"web lead",
138+
"lead generation",
139+
}
140+
]
125141
):
126142
return True
127143
return False

0 commit comments

Comments
 (0)