display json even if not valid json

This commit is contained in:
rimu 2024-10-02 20:29:09 +13:00
parent 0c493549e3
commit ac71830c72
2 changed files with 2 additions and 2 deletions

View file

@ -592,7 +592,7 @@ def admin_activities():
def activity_json(activity_id): def activity_json(activity_id):
activity = ActivityPubLog.query.get_or_404(activity_id) activity = ActivityPubLog.query.get_or_404(activity_id)
return render_template('admin/activity_json.html', title=_('Activity JSON'), return render_template('admin/activity_json.html', title=_('Activity JSON'),
activity_json_data=json.loads(activity.activity_json), activity=activity, activity_json_data=activity.activity_json, activity=activity,
current_app=current_app, current_app=current_app,
site=g.site) site=g.site)

View file

@ -11,7 +11,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Activity JSON') }}</h1> <h1>{{ _('Activity JSON') }}</h1>
<code><pre>{{ activity_json_data | tojson(indent=2) }}</pre></code> <code><p>{{ activity_json_data }}</p></code>
{% if current_app.debug %} {% if current_app.debug %}
<p><a class="btn btn-warning" href="{{ url_for('admin.activity_replay', activity_id=activity.id) }}">Re-submit this activity</a></p> <p><a class="btn btn-warning" href="{{ url_for('admin.activity_replay', activity_id=activity.id) }}">Re-submit this activity</a></p>
{% endif %} {% endif %}