peertube missing descriptions

This commit is contained in:
rimu 2024-09-30 16:02:06 +13:00
parent c37a01fde4
commit c5208b1afe

View file

@ -481,7 +481,7 @@ def refresh_user_profile_task(user_id):
user.title = activity_json['name'] user.title = activity_json['name']
if 'summary' in activity_json: if 'summary' in activity_json:
about_html = activity_json['summary'] about_html = activity_json['summary']
if not about_html.startswith('<'): # PeerTube if about_html is not None and not about_html.startswith('<'): # PeerTube
about_html = '<p>' + about_html + '</p>' about_html = '<p>' + about_html + '</p>'
user.about_html = allowlist_html(about_html) user.about_html = allowlist_html(about_html)
else: else:
@ -579,7 +579,7 @@ def refresh_community_profile_task(community_id):
else: else:
description_html = '' description_html = ''
if description_html != '': if description_html is not None and description_html != '':
if not description_html.startswith('<'): # PeerTube if not description_html.startswith('<'): # PeerTube
description_html = '<p>' + description_html + '</p>' description_html = '<p>' + description_html + '</p>'
community.description_html = allowlist_html(description_html) community.description_html = allowlist_html(description_html)
@ -704,7 +704,7 @@ def actor_json_to_model(activity_json, address, server):
if 'summary' in activity_json: if 'summary' in activity_json:
about_html = activity_json['summary'] about_html = activity_json['summary']
if not about_html.startswith('<'): # PeerTube if about_html is not None and not about_html.startswith('<'): # PeerTube
about_html = '<p>' + about_html + '</p>' about_html = '<p>' + about_html + '</p>'
user.about_html = allowlist_html(about_html) user.about_html = allowlist_html(about_html)
else: else:
@ -786,7 +786,7 @@ def actor_json_to_model(activity_json, address, server):
else: else:
description_html = '' description_html = ''
if description_html != '': if description_html is not None and description_html != '':
if not description_html.startswith('<'): # PeerTube if not description_html.startswith('<'): # PeerTube
description_html = '<p>' + description_html + '</p>' description_html = '<p>' + description_html + '</p>'
community.description_html = allowlist_html(description_html) community.description_html = allowlist_html(description_html)