Remove redundant function

main
Bob Mottram 2022-06-21 14:35:35 +01:00
parent 65d9b0680a
commit 763514eb69
3 changed files with 3 additions and 13 deletions

View File

@ -271,7 +271,6 @@ from utils import replace_users_with_at
from utils import local_actor_url
from utils import is_float
from utils import valid_password
from utils import remove_line_endings
from utils import get_base_content_from_post
from utils import acct_dir
from utils import get_image_extension_from_mime_type
@ -5643,9 +5642,9 @@ class PubServer(BaseHTTPRequestHandler):
if fields.get('password') and \
fields.get('passwordconfirm'):
fields['password'] = \
remove_line_endings(fields['password'])
remove_eol(fields['password']).strip()
fields['passwordconfirm'] = \
remove_line_endings(fields['passwordconfirm'])
remove_eol(fields['passwordconfirm']).strip()
if valid_password(fields['password']) and \
fields['password'] == fields['passwordconfirm']:
# set password

View File

@ -63,7 +63,6 @@ from utils import get_group_paths
from utils import local_actor_url
from utils import dangerous_svg
from utils import text_in_file
from utils import remove_line_endings
from session import create_session
from session import get_json
from webfinger import webfinger_handle
@ -542,7 +541,7 @@ def _create_person_base(base_dir: str, nickname: str, domain: str, port: int,
print('EX: unable to save 2 ' + filename)
if password:
password = remove_line_endings(password)
password = remove_eol(password).strip()
store_basic_credentials(base_dir, nickname, password)
return private_key_pem, public_key_pem, new_person, webfinger_endpoint

View File

@ -3276,14 +3276,6 @@ def valid_url_prefix(url: str) -> bool:
return False
def remove_line_endings(text: str) -> str:
"""Removes any newline from the end of a string
"""
text = text.replace('\n', '')
text = text.replace('\r', '')
return text.strip()
def valid_password(password: str) -> bool:
"""Returns true if the given password is valid
"""