Atualizar app/app.py
This commit is contained in:
+2
-2
@@ -825,7 +825,7 @@ def import_file(cid):
|
|||||||
file.save(path)
|
file.save(path)
|
||||||
|
|
||||||
ext = file.filename.lower().split(".")[-1]
|
ext = file.filename.lower().split(".")[-1]
|
||||||
if ext not in ["doc", "docx", "odt", "txt", "md", "html", "htm"]:
|
if ext not in ["doc", "docx", "odt", "txt", "md", "html", "htm", "rtf", "epub"]:
|
||||||
return jsonify({"erro": "Formato não suportado."}), 400
|
return jsonify({"erro": "Formato não suportado."}), 400
|
||||||
|
|
||||||
if ext == "pdf":
|
if ext == "pdf":
|
||||||
@@ -858,7 +858,7 @@ def import_file(cid):
|
|||||||
@app.route("/api/export/pandoc/<writer>/<cid>/<filename>")
|
@app.route("/api/export/pandoc/<writer>/<cid>/<filename>")
|
||||||
@login_required
|
@login_required
|
||||||
def export_pandoc(writer, cid, filename):
|
def export_pandoc(writer, cid, filename):
|
||||||
if not writer in ["docx","xlsx","pptx","markdown","txt","odt","html"]:
|
if not writer in ["docx","xlsx","pptx","markdown","txt","odt","rtf","epub","html"]:
|
||||||
return jsonify({"erro": "Formato de exportação não suportado."}), 400
|
return jsonify({"erro": "Formato de exportação não suportado."}), 400
|
||||||
email = session["db_user"]["email"] if app.config["AUTH_MODE"] == "db" else session["user"]["email"]
|
email = session["db_user"]["email"] if app.config["AUTH_MODE"] == "db" else session["user"]["email"]
|
||||||
db = SessionLocal()
|
db = SessionLocal()
|
||||||
|
|||||||
Reference in New Issue
Block a user