fix: more pylint

This commit is contained in:
Mathias DUPEUX 2025-03-05 17:01:10 +01:00
parent 836b91aa67
commit 417fceacb0
3 changed files with 17 additions and 6 deletions

View file

@ -1,5 +1,7 @@
from flask import Blueprint, request, render_template
"""Used for editor/editor's preview"""
import base64
from flask import Blueprint, request, render_template
editor_routes = Blueprint('simple_page', __name__, template_folder='templates')
@ -10,9 +12,10 @@ def editor():
@editor_routes.route("/preview/<b64>")
@editor_routes.route("/preview/")
def preview(b64:str=""):
"""Return a preview to show in the editor"""
is_real_preview = request.args.get("website", False, type=bool)
content = base64.b64decode(b64).decode("utf-8")
if is_real_preview:
return render_template("editor/demo.html", written=content)
else:
return render_template("editor/preview.html", content=content)
return render_template("editor/preview.html", content=content)