still return HTTP 200 even if activity was not logged. Hopefully friendca will cope #103

This commit is contained in:
rimu 2024-03-17 02:02:32 +13:00
parent eaca1ccfaf
commit ff42ae3f1f

View file

@ -1104,7 +1104,10 @@ def post_ap(post_id):
def activities_json(type, id):
activity = ActivityPubLog.query.filter_by(activity_id=f"https://{current_app.config['SERVER_NAME']}/activities/{type}/{id}").first()
if activity:
activity_json = json.loads(activity.activity_json)
if activity.activity_json is not None:
activity_json = json.loads(activity.activity_json)
else:
activity_json = {}
resp = jsonify(activity_json)
resp.content_type = 'application/activity+json'
return resp