diff --git a/webapp_post.py b/webapp_post.py index dddab6bbe..4ca0018e5 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1577,8 +1577,9 @@ def _get_post_title_announce_html(base_dir: str, actor_type = get_actor_type(base_dir, attributed_to, person_cache) bot_prefix = '' - if actor_type != 'Person': - bot_prefix = '[' + translate['Bot'] + '] ' + if actor_type: + if actor_type != 'Person': + bot_prefix = '[' + translate['Bot'] + '] ' _log_post_timing(enable_timing_log, post_start_time, '13.3.1') announce_display_name2 = \ @@ -1728,8 +1729,9 @@ def _get_reply_html(translate: {}, mutual_prefix = '⇆ ' bot_prefix = '' - if actor_type != 'Person': - bot_prefix = '[' + translate['Bot'] + '] ' + if actor_type: + if actor_type != 'Person': + bot_prefix = '[' + translate['Bot'] + '] ' replying_to_str = _replying_to_with_scope(post_json_object, translate) post_bookmark = '#' + bookmark_from_id(in_reply_to) @@ -2689,8 +2691,9 @@ def individual_post_as_html(signing_priv_key_pem: str, actor_type = get_actor_type(base_dir, post_actor, person_cache) bot_prefix = '' - if actor_type != 'Person': - bot_prefix = '[' + translate['Bot'] + '] ' + if actor_type: + if actor_type != 'Person': + bot_prefix = '[' + translate['Bot'] + '] ' if display_name: display_name = _enforce_max_display_name_length(display_name) diff --git a/webapp_profile.py b/webapp_profile.py index 650fb2248..f60494231 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -350,9 +350,10 @@ def html_profile_after_search(authorized: bool, # is this a bot account? if profile_json.get('type'): - if isinstance(profile_json['type'], str): - if profile_json['type'] != 'Person': - display_name = '[' + translate['Bot'] + '] ' + display_name + if profile_json['type']: + if isinstance(profile_json['type'], str): + if profile_json['type'] != 'Person': + display_name = '[' + translate['Bot'] + '] ' + display_name pronouns = get_pronouns(profile_json) discord = get_discord(profile_json) @@ -1185,9 +1186,10 @@ def html_profile(signing_priv_key_pem: str, # is this a bot account? if profile_json.get('type'): - if isinstance(profile_json['type'], str): - if profile_json['type'] != 'Person': - display_name = '[' + translate['Bot'] + '] ' + display_name + if profile_json['type']: + if isinstance(profile_json['type'], str): + if profile_json['type'] != 'Person': + display_name = '[' + translate['Bot'] + '] ' + display_name domain_full = get_full_domain(domain, port) profile_status = get_actor_status(profile_json)