mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
6ecc96c043
commit
438dcce9e3
8
posts.py
8
posts.py
|
@ -43,7 +43,7 @@ from utils import remove_domain_port
|
||||||
from utils import get_port_from_domain
|
from utils import get_port_from_domain
|
||||||
from utils import has_object_dict
|
from utils import has_object_dict
|
||||||
from utils import reject_post_id
|
from utils import reject_post_id
|
||||||
from utils import removeInvalidChars
|
from utils import remove_invalid_chars
|
||||||
from utils import fileLastModified
|
from utils import fileLastModified
|
||||||
from utils import isPublicPost
|
from utils import isPublicPost
|
||||||
from utils import has_users_path
|
from utils import has_users_path
|
||||||
|
@ -1002,7 +1002,7 @@ def validContentWarning(cw: str) -> str:
|
||||||
# so remove them
|
# so remove them
|
||||||
if '#' in cw:
|
if '#' in cw:
|
||||||
cw = cw.replace('#', '').replace(' ', ' ')
|
cw = cw.replace('#', '').replace(' ', ' ')
|
||||||
return removeInvalidChars(cw)
|
return remove_invalid_chars(cw)
|
||||||
|
|
||||||
|
|
||||||
def _loadAutoCW(base_dir: str, nickname: str, domain: str) -> []:
|
def _loadAutoCW(base_dir: str, nickname: str, domain: str) -> []:
|
||||||
|
@ -1385,7 +1385,7 @@ def _createPostBase(base_dir: str,
|
||||||
content_license_url: str) -> {}:
|
content_license_url: str) -> {}:
|
||||||
"""Creates a message
|
"""Creates a message
|
||||||
"""
|
"""
|
||||||
content = removeInvalidChars(content)
|
content = remove_invalid_chars(content)
|
||||||
|
|
||||||
subject = _addAutoCW(base_dir, nickname, domain, subject, content)
|
subject = _addAutoCW(base_dir, nickname, domain, subject, content)
|
||||||
|
|
||||||
|
@ -1434,7 +1434,7 @@ def _createPostBase(base_dir: str,
|
||||||
sensitive = False
|
sensitive = False
|
||||||
summary = None
|
summary = None
|
||||||
if subject:
|
if subject:
|
||||||
summary = removeInvalidChars(validContentWarning(subject))
|
summary = remove_invalid_chars(validContentWarning(subject))
|
||||||
sensitive = True
|
sensitive = True
|
||||||
|
|
||||||
toRecipients = []
|
toRecipients = []
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -774,7 +774,7 @@ def contains_invalid_chars(json_str: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def removeInvalidChars(text: str) -> str:
|
def remove_invalid_chars(text: str) -> str:
|
||||||
"""Removes any invalid characters from a string
|
"""Removes any invalid characters from a string
|
||||||
"""
|
"""
|
||||||
for is_invalid in INVALID_CHARACTERS:
|
for is_invalid in INVALID_CHARACTERS:
|
||||||
|
|
Loading…
Reference in New Issue