From 04975770f555eb3cd49da571bc7440fa67f59d30 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 17 Jan 2024 20:46:20 +0000 Subject: [PATCH] If a summary exists set sensitive flag --- webapp_post.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webapp_post.py b/webapp_post.py index 8b8ff128e..67dc609f9 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -2734,6 +2734,9 @@ def individual_post_as_html(signing_priv_key_pem: str, if content_str: summary_str = get_summary_from_post(post_json_object, system_language, languages_understood) + if summary_str == 'null': + summary_str = '' + # add dogwhistle warnings to summary summary_str = _add_dogwhistle_warnings(summary_str, content_str, dogwhistles, translate) @@ -2789,6 +2792,8 @@ def individual_post_as_html(signing_priv_key_pem: str, if not summary_str: summary_str = get_summary_from_post(post_json_object, system_language, languages_understood) + if summary_str == 'null': + summary_str = '' if content_str: # add dogwhistle warnings to summary summary_str = _add_dogwhistle_warnings(summary_str, content_str, @@ -2797,6 +2802,9 @@ def individual_post_as_html(signing_priv_key_pem: str, summary_str = add_auto_cw(base_dir, nickname, domain, summary_str, content_str) + if summary_str and not post_is_sensitive: + post_is_sensitive = True + _log_post_timing(enable_timing_log, post_start_time, '16') if not is_pgp_encrypted(content_str):