Display threads locally when possible

This commit is contained in:
Thomas Sileo
2018-07-14 12:29:46 +02:00
parent d8f7967e6a
commit 0a53cba5f5
2 changed files with 27 additions and 7 deletions

17
app.py
View File

@@ -1168,6 +1168,23 @@ def admin():
)
@app.route("/admin/thread")
@login_required
def admin_thread():
data = DB.activities.find_one(
{"$or": [{"remote_id": request.args.get("oid")}, {"activity.object.id": request.args.get("oid")}]}
)
if not data:
abort(404)
if data["meta"].get("deleted", False):
abort(410)
thread = _build_thread(data)
return render_template(
"note.html", thread=thread, note=data
)
@app.route("/admin/new", methods=["GET"])
@login_required
def admin_new():