Avoid unhandled 500 on problem retrieving admins

pull/20/head
db0 2023-09-07 18:22:21 +02:00
parent 6c2f7ba838
commit 9c9b7ec2ed
1 changed files with 4 additions and 1 deletions

View File

@ -149,7 +149,10 @@ class ActivityPubPM:
return None
admins = database.find_admins_by_instance(instance)
if not admins:
try:
admins = get_admin_for_software(software, domain)
except Exception as err:
raise e.BadRequest(f"Failed to retrieve admin list: {err}")
else:
admins = [a.username for a in admins]
if not admins: