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

Commit 782dcfb

Browse files
Update main.py
- Can now reach archived legal tempates - Can now send the PDF version.
1 parent b7572b0 commit 782dcfb

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/main.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, render_template, redirect, abort
1+
from flask import Flask, render_template, redirect, abort, send_file
22
from flask_socketio import SocketIO, emit, join_room
33
from document import Document
44
from config import DEBUG
@@ -26,6 +26,12 @@ def create_document():
2626
return redirect(f"/{doc_id}")
2727

2828

29+
@app.route("/tos-pdf")
30+
def pdf_tos():
31+
"""Reroute to ToS PDF."""
32+
return send_file("templates/legal/tos-pdf.pdf")
33+
34+
2935
@app.route("/<doc_id>")
3036
@app.route("/editor/<doc_id>")
3137
def editor(doc_id):
@@ -54,6 +60,15 @@ def tos():
5460
return render_template("legal/tos.html")
5561

5662

63+
@app.route("/tos/archive/<doc_id>")
64+
@app.route("/tac/archive/<doc_id>")
65+
@app.route("/termsofservice/archive/<doc_id>")
66+
@app.route("/terms-of-service/archive/<doc_id>")
67+
def tos_archive(doc_id):
68+
"""Render terms of service form archive."""
69+
return render_template(f"legal/archive/tos-{doc_id}.html")
70+
71+
5772
@app.route("/privacy")
5873
@app.route("/privacypolicy")
5974
@app.route("/privacy-policy")
@@ -83,8 +98,6 @@ def update_text(data):
8398
db.update_document(data["room"], json.dumps(document.document_dict))
8499

85100

86-
87-
88101
@socketio.on("save")
89102
def update_text(data):
90103
db.update_document(data["room"], json.dumps(data["requests"][0]["data"]))

0 commit comments

Comments
 (0)