diff --git a/crates/api_crud/src/post/create.rs b/crates/api_crud/src/post/create.rs index 452144faa..e9e11bc16 100644 --- a/crates/api_crud/src/post/create.rs +++ b/crates/api_crud/src/post/create.rs @@ -86,6 +86,9 @@ pub async fn create_post( let community = Community::read(&mut context.pool(), data.community_id).await?; check_community_user_action(&local_user_view.person, &community, &mut context.pool()).await?; + // If its an NSFW community, then use that as a default + let nsfw = data.nsfw.or(Some(community.nsfw)); + if community.posting_restricted_to_mods { let community_id = data.community_id; CommunityModeratorView::check_is_community_moderator( @@ -110,7 +113,7 @@ pub async fn create_post( url, body, alt_text: data.alt_text.clone(), - nsfw: data.nsfw, + nsfw, language_id: Some(language_id), scheduled_publish_time, ..PostInsertForm::new(