Skip to content
Permalink
Browse files

Temporarily stop hiding suspected spam

because it looks like a bug.
  • Loading branch information...
charmander committed Oct 10, 2019
1 parent 4ae4b32 commit 9a7a130439d9055ed77f3e1913ec870920521bb4
Showing with 5 additions and 19 deletions.
  1. +2 −7 weasyl/journal.py
  2. +3 −12 weasyl/submission.py
@@ -71,10 +71,6 @@ def create(userid, journal, friends_only=False, tags=None):
# Assign search tags
searchtag.associate(userid, tags, journalid=journalid)

# If the journal was spam, block creation of the notifications, and notify user it is being held.
if is_spam:
raise WeasylError("SpamFilteringDelayed")

# Create notifications
if "m" not in settings:
welcome.journal_insert(userid, journalid, rating=journal.rating.code,
@@ -101,7 +97,7 @@ def _select_journal_and_check(userid, journalid, rating=None, ignore=True, anywa
"""

query = d.engine.execute("""
SELECT jo.userid, pr.username, jo.unixtime, jo.title, jo.content, jo.rating, jo.settings, jo.page_views, pr.config, jo.is_spam
SELECT jo.userid, pr.username, jo.unixtime, jo.title, jo.content, jo.rating, jo.settings, jo.page_views, pr.config
FROM journal jo JOIN profile pr ON jo.userid = pr.userid
WHERE jo.journalid = %(id)s
""", id=journalid).first()
@@ -111,7 +107,7 @@ def _select_journal_and_check(userid, journalid, rating=None, ignore=True, anywa
raise WeasylError('journalRecordMissing')
elif journalid and userid in staff.MODS and anyway:
pass
elif not query or 'h' in query.settings or query.is_spam:
elif not query or 'h' in query.settings:
raise WeasylError('journalRecordMissing')
elif query.rating > rating and ((userid != query.userid and userid not in staff.MODS) or d.is_sfw_mode()):
raise WeasylError('RatingExceeded')
@@ -279,7 +275,6 @@ def select_latest(userid, rating, otherid=None):
if otherid:
statement.append(
" AND jo.userid = %i AND jo.settings !~ '[%sh]'" % (otherid, "" if frienduser.check(userid, otherid) else "f"))
statement.append(" AND NOT is_spam ")

statement.append("ORDER BY jo.journalid DESC LIMIT 1")
query = d.execute("".join(statement), options="single")
@@ -290,9 +290,6 @@ def create_visual(userid, submission,
# Assign search tags
searchtag.associate(userid, tags, submitid=submitid)

if is_spam:
raise WeasylError("SpamFilteringDelayed")

# Create notifications
if create_notifications:
_create_notifications(userid, submitid, submission.rating, settings,
@@ -402,9 +399,6 @@ def create_literary(userid, submission, embedlink=None, friends_only=False, tags
_create_notifications(userid, submitid, submission.rating, settings,
submission.title, tags)

if is_spam:
raise WeasylError("SpamFilteringDelayed")

d.metric('increment', 'submissions')
d.metric('increment', 'literarysubmissions')

@@ -517,9 +511,6 @@ def create_multimedia(userid, submission, embedlink=None, friends_only=None,
orm.SubmissionMediaLink.make_or_replace_link(submitid, 'thumbnail-custom',
tempthumb_media_item)

if is_spam:
raise WeasylError("SpamFilteringDelayed")

# Create notifications
if create_notifications:
_create_notifications(userid, submitid, submission.rating, settings,
@@ -588,7 +579,7 @@ def select_view(userid, submitid, rating, ignore=True, anyway=None):
query = d.execute("""
SELECT
su.userid, pr.username, su.folderid, su.unixtime, su.title, su.content, su.subtype, su.rating, su.settings,
su.page_views, su.sorttime, pr.config, fd.title, su.is_spam
su.page_views, su.sorttime, pr.config, fd.title
FROM submission su
INNER JOIN profile pr USING (userid)
LEFT JOIN folder fd USING (folderid)
@@ -598,7 +589,7 @@ def select_view(userid, submitid, rating, ignore=True, anyway=None):
# Sanity check
if query and userid in staff.MODS and anyway == "true":
pass
elif not query or "h" in query[8] or query[13]:
elif not query or "h" in query[8]:
raise WeasylError("submissionRecordMissing")
elif query[7] > rating and ((userid != query[0] and userid not in staff.MODS) or d.is_sfw_mode()):
raise WeasylError("RatingExceeded")
@@ -685,7 +676,7 @@ def select_view_api(userid, submitid, anyway=False, increment_views=False):
rating = d.get_rating(userid)
db = d.connect()
sub = db.query(orm.Submission).get(submitid)
if sub is None or 'hidden' in sub.settings or sub.is_spam:
if sub is None or 'hidden' in sub.settings:
raise WeasylError("submissionRecordMissing")
sub_rating = sub.rating.code
if 'friends-only' in sub.settings and not frienduser.check(userid, sub.userid):

0 comments on commit 9a7a130

Please sign in to comment.
You can’t perform that action at this time.