Snake case

merge-requests/30/head
Bob Mottram 2021-12-26 18:08:08 +00:00
parent cd5a897184
commit a711a29dbd
3 changed files with 6 additions and 6 deletions

View File

@ -253,7 +253,7 @@ from utils import replace_users_with_at
from utils import local_actor_url from utils import local_actor_url
from utils import is_float from utils import is_float
from utils import valid_password from utils import valid_password
from utils import removeLineEndings from utils import remove_line_endings
from utils import get_base_content_from_post from utils import get_base_content_from_post
from utils import acct_dir from utils import acct_dir
from utils import getImageExtensionFromMimeType from utils import getImageExtensionFromMimeType
@ -4968,9 +4968,9 @@ class PubServer(BaseHTTPRequestHandler):
if fields.get('password') and \ if fields.get('password') and \
fields.get('passwordconfirm'): fields.get('passwordconfirm'):
fields['password'] = \ fields['password'] = \
removeLineEndings(fields['password']) remove_line_endings(fields['password'])
fields['passwordconfirm'] = \ fields['passwordconfirm'] = \
removeLineEndings(fields['passwordconfirm']) remove_line_endings(fields['passwordconfirm'])
if valid_password(fields['password']) and \ if valid_password(fields['password']) and \
fields['password'] == fields['passwordconfirm']: fields['password'] == fields['passwordconfirm']:
# set password # set password

View File

@ -41,7 +41,7 @@ from media import processMetaData
from utils import removeHtml from utils import removeHtml
from utils import containsInvalidChars from utils import containsInvalidChars
from utils import replace_users_with_at from utils import replace_users_with_at
from utils import removeLineEndings from utils import remove_line_endings
from utils import removeDomainPort from utils import removeDomainPort
from utils import getStatusNumber from utils import getStatusNumber
from utils import get_full_domain from utils import get_full_domain
@ -533,7 +533,7 @@ def _createPersonBase(base_dir: str, nickname: str, domain: str, port: int,
print('EX: unable to save 2 ' + filename) print('EX: unable to save 2 ' + filename)
if password: if password:
password = removeLineEndings(password) password = remove_line_endings(password)
storeBasicCredentials(base_dir, nickname, password) storeBasicCredentials(base_dir, nickname, password)
return privateKeyPem, publicKeyPem, newPerson, webfingerEndpoint return privateKeyPem, publicKeyPem, newPerson, webfingerEndpoint

View File

@ -2945,7 +2945,7 @@ def validUrlPrefix(url: str) -> bool:
return False return False
def removeLineEndings(text: str) -> str: def remove_line_endings(text: str) -> str:
"""Removes any newline from the end of a string """Removes any newline from the end of a string
""" """
text = text.replace('\n', '') text = text.replace('\n', '')