From 438dcce9e34b4cf5b1ebeffd2cbee1fbd83384ca Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 27 Dec 2021 19:33:45 +0000 Subject: [PATCH] Snake case --- posts.py | 8 ++++---- utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/posts.py b/posts.py index 4ec06eff7..a81c309e8 100644 --- a/posts.py +++ b/posts.py @@ -43,7 +43,7 @@ from utils import remove_domain_port from utils import get_port_from_domain from utils import has_object_dict from utils import reject_post_id -from utils import removeInvalidChars +from utils import remove_invalid_chars from utils import fileLastModified from utils import isPublicPost from utils import has_users_path @@ -1002,7 +1002,7 @@ def validContentWarning(cw: str) -> str: # so remove them if '#' in cw: cw = cw.replace('#', '').replace(' ', ' ') - return removeInvalidChars(cw) + return remove_invalid_chars(cw) def _loadAutoCW(base_dir: str, nickname: str, domain: str) -> []: @@ -1385,7 +1385,7 @@ def _createPostBase(base_dir: str, content_license_url: str) -> {}: """Creates a message """ - content = removeInvalidChars(content) + content = remove_invalid_chars(content) subject = _addAutoCW(base_dir, nickname, domain, subject, content) @@ -1434,7 +1434,7 @@ def _createPostBase(base_dir: str, sensitive = False summary = None if subject: - summary = removeInvalidChars(validContentWarning(subject)) + summary = remove_invalid_chars(validContentWarning(subject)) sensitive = True toRecipients = [] diff --git a/utils.py b/utils.py index f1242f61d..2fc628a90 100644 --- a/utils.py +++ b/utils.py @@ -774,7 +774,7 @@ def contains_invalid_chars(json_str: str) -> bool: return False -def removeInvalidChars(text: str) -> str: +def remove_invalid_chars(text: str) -> str: """Removes any invalid characters from a string """ for is_invalid in INVALID_CHARACTERS: