diff --git a/README.md b/README.md
index fadfc39..739a19d 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@
- Private "bookmark" support
- List support
- Allows you to attach files to your notes
- - Custom emojus
+ - Custom emojos
- Cares about your privacy
- The image upload endpoint strips EXIF meta data before storing the file
- Every attachment/media is cached (or proxied) by the server
diff --git a/app.py b/app.py
index 58895e3..9ddb269 100644
--- a/app.py
+++ b/app.py
@@ -1,4 +1,5 @@
import json
+from werkzeug.exceptions import InternalServerError
import logging
import os
import traceback
@@ -214,6 +215,18 @@ def handle_task_error(error):
return response
+@app.errorhandler(InternalServerError)
+def handle_500(e):
+ tb = "".join(traceback.format_tb(e.__traceback__))
+ logger.error(f"caught error {e!r}, {tb}")
+ if not session.get("logged_in", False):
+ tb = None
+
+ return render_template(
+ "error.html", code=500, status_text="Internal Server Error", tb=tb
+ )
+
+
# @app.errorhandler(Exception)
# def handle_other_error(error):
# logger.error(
diff --git a/core/shared.py b/core/shared.py
index 6a1048e..2d7eb5a 100644
--- a/core/shared.py
+++ b/core/shared.py
@@ -144,7 +144,8 @@ def _build_thread(data, include_children=True): # noqa: C901
data["_requested"] = True
app.logger.info(f"_build_thread({data!r})")
root_id = data["meta"].get(
- MetaKey.THREAD_ROOT_PARENT.value, data["meta"][MetaKey.OBJECT_ID.value]
+ MetaKey.THREAD_ROOT_PARENT.value,
+ data["meta"].get(MetaKey.OBJECT_ID.value, data["meta"].get("remote_id")),
)
replies = [data]
diff --git a/templates/header.html b/templates/header.html
index 708171c..766aa96 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -1,4 +1,3 @@
-{% if not request.path.startswith('/admin') %}
Lists and its members are private.
diff --git a/templates/lookup.html b/templates/lookup.html index 21a19a9..744caff 100644 --- a/templates/lookup.html +++ b/templates/lookup.html @@ -3,7 +3,6 @@ {% block title %}Lookup - {{ config.NAME }}{% endblock %} {% block content %}