From 355d0cd860727c3d6f48ec857b807743d7f8fd01 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:24:53 +1300 Subject: [PATCH] ensure posts are tagged as nsfw inside nsfw communities --- app/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 9714869b..75d27ae9 100644 --- a/app/models.py +++ b/app/models.py @@ -1201,7 +1201,10 @@ class Post(db.Model): microblog=microblog, posted_at=utcnow() ) - + if community.nsfw: + post.nsfw = True # old Lemmy instances ( < 0.19.8 ) allow nsfw content in nsfw communities to be flagged as sfw which makes no sense + if community.nsfl: + post.nsfl = True if 'content' in request_json['object'] and request_json['object']['content'] is not None: if 'mediaType' in request_json['object'] and request_json['object']['mediaType'] == 'text/html': post.body_html = allowlist_html(request_json['object']['content'])