From c5208b1afe81fac944e51b834e5eb01a9ef5769b Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:02:06 +1300 Subject: [PATCH] peertube missing descriptions --- app/activitypub/util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 9ee03c43..25fcd060 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -481,7 +481,7 @@ def refresh_user_profile_task(user_id): user.title = activity_json['name'] if 'summary' in activity_json: 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 = '

' + about_html + '

' user.about_html = allowlist_html(about_html) else: @@ -579,7 +579,7 @@ def refresh_community_profile_task(community_id): else: description_html = '' - if description_html != '': + if description_html is not None and description_html != '': if not description_html.startswith('<'): # PeerTube description_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: 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 = '

' + about_html + '

' user.about_html = allowlist_html(about_html) else: @@ -786,7 +786,7 @@ def actor_json_to_model(activity_json, address, server): else: description_html = '' - if description_html != '': + if description_html is not None and description_html != '': if not description_html.startswith('<'): # PeerTube description_html = '

' + description_html + '

' community.description_html = allowlist_html(description_html)