Check that actor summary exists

main
Bob Mottram 2024-05-15 17:21:18 +01:00
parent 4d38cce27b
commit 403c3a288d
2 changed files with 7 additions and 3 deletions

View File

@ -841,7 +841,9 @@ def html_header_with_person_markup(css_filename: str, instance_title: str,
first_entry = False
skills_markup += '\n ],\n'
description = remove_html(actor_json['summary'])
description = ''
if actor_json.get('summary'):
description = remove_html(actor_json['summary'])
name_str = remove_html(actor_json['name'])
domain_full = actor_json['id'].split('://')[1].split('/')[0]
handle = actor_json['preferredUsername'] + '@' + domain_full

View File

@ -112,8 +112,10 @@ def html_welcome_profile(base_dir: str, nickname: str, domain: str,
edit_text_field(translate['Nickname'], 'displayNickname',
display_nickname)
bio_str = \
actor_json['summary'].replace('<p>', '').replace('</p>', '')
bio_str = ''
if actor_json.get('summary'):
bio_str = \
actor_json['summary'].replace('<p>', '').replace('</p>', '')
if not bio_str:
bio_str = translate['Your bio']
profile_form += ' <label class="labels">' + \