Don't include petnames in search on profile screen

merge-requests/30/head
Bob Mottram 2022-12-31 23:04:18 +00:00
parent c837d20f2a
commit 18ca9aaa32
3 changed files with 5 additions and 4 deletions

View File

@ -1026,7 +1026,7 @@ def html_new_post(edit_post_params: {},
'list="followingHandles" value="' + mentions_str + '" selected>\n' 'list="followingHandles" value="' + mentions_str + '" selected>\n'
new_post_form += \ new_post_form += \
html_following_data_list(base_dir, nickname, domain, domain_full, html_following_data_list(base_dir, nickname, domain, domain_full,
'following') 'following', True)
new_post_form += '' new_post_form += ''
selected_str = '' selected_str = ''

View File

@ -1114,7 +1114,7 @@ def html_profile(signing_priv_key_pem: str,
'list="' + selected + 'Handles" placeholder="🔎">\n' 'list="' + selected + 'Handles" placeholder="🔎">\n'
follow_search_str += \ follow_search_str += \
html_following_data_list(base_dir, nickname, domain, html_following_data_list(base_dir, nickname, domain,
domain_full, selected) domain_full, selected, False)
follow_search_str += \ follow_search_str += \
' <button type="submit" class="button" ' + \ ' <button type="submit" class="button" ' + \
'name="submitSearch">' + translate['Search'] + '</button>\n' 'name="submitSearch">' + translate['Search'] + '</button>\n'

View File

@ -1971,7 +1971,8 @@ def get_default_path(media_instance: bool, blogs_instance: bool,
def html_following_data_list(base_dir: str, nickname: str, def html_following_data_list(base_dir: str, nickname: str,
domain: str, domain_full: str, domain: str, domain_full: str,
following_type: str) -> str: following_type: str,
use_petnames: bool) -> str:
"""Returns a datalist of handles being followed """Returns a datalist of handles being followed
followingHandles, followersHandles followingHandles, followersHandles
""" """
@ -1990,7 +1991,7 @@ def html_following_data_list(base_dir: str, nickname: str,
# include petnames # include petnames
petnames_filename = \ petnames_filename = \
acct_dir(base_dir, nickname, domain) + '/petnames.txt' acct_dir(base_dir, nickname, domain) + '/petnames.txt'
if os.path.isfile(petnames_filename): if use_petnames and os.path.isfile(petnames_filename):
following_list = [] following_list = []
with open(petnames_filename, 'r', with open(petnames_filename, 'r',
encoding='utf-8') as petnames_file: encoding='utf-8') as petnames_file: