Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

Commit 316f68b

Browse files
ToS and PP archive error catches
1 parent 0a15d3f commit 316f68b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/main.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ def tos():
7272
@app.route("/terms-of-service/archive/<doc_id>")
7373
def tos_archive(doc_id):
7474
"""Render terms of service form archive."""
75-
return render_template(f"legal/archive/tos-{doc_id}.html")
75+
try:
76+
return render_template(f"legal/archive/tos-{doc_id}.html")
77+
except Exception as e:
78+
if DEBUG:
79+
print(e)
80+
return abort(404)
7681

7782

7883
@app.route("/privacy")
@@ -88,7 +93,12 @@ def privacy():
8893
@app.route("/privacy-policy/archive/<doc_id>")
8994
def privacy_archive(doc_id):
9095
"""Render privacy policy from archive."""
91-
return render_template(f"legal/archive/privacy-{doc_id}.html")
96+
try:
97+
return render_template(f"legal/archive/privacy-{doc_id}.html")
98+
except Exception as e:
99+
if DEBUG:
100+
print(e)
101+
return abort(404)
92102

93103

94104
@app.route("/licence")

0 commit comments

Comments
 (0)