Check that an actor type is returned

main
bashrc 2026-02-02 15:12:24 +00:00
parent 68dc6ecab0
commit e21fce2938
2 changed files with 17 additions and 12 deletions

View File

@ -1577,6 +1577,7 @@ def _get_post_title_announce_html(base_dir: str,
actor_type = get_actor_type(base_dir, attributed_to, person_cache) actor_type = get_actor_type(base_dir, attributed_to, person_cache)
bot_prefix = '' bot_prefix = ''
if actor_type:
if actor_type != 'Person': if actor_type != 'Person':
bot_prefix = '[' + translate['Bot'] + '] ' bot_prefix = '[' + translate['Bot'] + '] '
@ -1728,6 +1729,7 @@ def _get_reply_html(translate: {},
mutual_prefix = '' mutual_prefix = ''
bot_prefix = '' bot_prefix = ''
if actor_type:
if actor_type != 'Person': if actor_type != 'Person':
bot_prefix = '[' + translate['Bot'] + '] ' bot_prefix = '[' + translate['Bot'] + '] '
@ -2689,6 +2691,7 @@ def individual_post_as_html(signing_priv_key_pem: str,
actor_type = get_actor_type(base_dir, post_actor, person_cache) actor_type = get_actor_type(base_dir, post_actor, person_cache)
bot_prefix = '' bot_prefix = ''
if actor_type:
if actor_type != 'Person': if actor_type != 'Person':
bot_prefix = '[' + translate['Bot'] + '] ' bot_prefix = '[' + translate['Bot'] + '] '

View File

@ -350,6 +350,7 @@ def html_profile_after_search(authorized: bool,
# is this a bot account? # is this a bot account?
if profile_json.get('type'): if profile_json.get('type'):
if profile_json['type']:
if isinstance(profile_json['type'], str): if isinstance(profile_json['type'], str):
if profile_json['type'] != 'Person': if profile_json['type'] != 'Person':
display_name = '[' + translate['Bot'] + '] ' + display_name display_name = '[' + translate['Bot'] + '] ' + display_name
@ -1185,6 +1186,7 @@ def html_profile(signing_priv_key_pem: str,
# is this a bot account? # is this a bot account?
if profile_json.get('type'): if profile_json.get('type'):
if profile_json['type']:
if isinstance(profile_json['type'], str): if isinstance(profile_json['type'], str):
if profile_json['type'] != 'Person': if profile_json['type'] != 'Person':
display_name = '[' + translate['Bot'] + '] ' + display_name display_name = '[' + translate['Bot'] + '] ' + display_name