diff --git a/files/helpers/const.py b/files/helpers/const.py index 0f8c435a8..707ef22e8 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -765,6 +765,7 @@ NOTIFIED_USERS = { 'joan': JOAN_ID, 'pewkie': JOAN_ID, 'carp': CARP_ID, + 'carp': DONGER_ID, 'idio3': IDIO_ID, 'idio ': IDIO_ID, 'landlord_messiah': LLM_ID, diff --git a/files/routes/posts.py b/files/routes/posts.py index bdff3691e..955f61738 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -554,6 +554,8 @@ def archiveorg(url): def thumbnail_thread(pid): + db = db_session() + print(cpu_percent(), flush=True) time.sleep(0.1) @@ -571,8 +573,8 @@ def thumbnail_thread(pid): kind="enable_under_attack", user_id=AUTOJANNY_ID, ) - g.db.add(ma) - g.db.commit() + db.add(ma) + db.commit() data='{"value":"under_attack"}' response = requests.patch(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/settings/security_level', headers=CF_HEADERS, data=data) print(response.text, flush=True) @@ -591,8 +593,6 @@ def thumbnail_thread(pid): else: return f"{post_url}{'/' if not post_url.endswith('/') else ''}{fragment_url}" - db = db_session() - post = db.query(Submission).filter_by(id=pid).one_or_none() if not post or not post.url: diff --git a/files/templates/comments.html b/files/templates/comments.html index 2b7a9609a..a851e3983 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -139,7 +139,7 @@ {% endif %} {% if standalone and level==1 %} -
+
{% if c.post and c.post.over_18 %}+18{% endif %} {% if c.post %}