rename /quick -> /extra

This commit is contained in:
boyska 2019-07-08 10:53:19 +02:00
parent 52ae0acf8a
commit 39a7295849

View file

@ -126,8 +126,10 @@ def edit_time(alarmid):
"add_time_kind.html", form=form, kind=kind, mode="edit", alarmid=alarmid "add_time_kind.html", form=form, kind=kind, mode="edit", alarmid=alarmid
) )
def is_xhr(): def is_xhr():
return request.headers.get('x-requested-with') is not None return request.headers.get("x-requested-with") is not None
@db.route("/add/time/<kind>", methods=["GET", "POST"]) @db.route("/add/time/<kind>", methods=["GET", "POST"])
def addtime_kind(kind): def addtime_kind(kind):
@ -249,9 +251,9 @@ def delete_alarm(alarmid):
return redirect(url_for("db.events_list")) return redirect(url_for("db.events_list"))
@db.route("/quick/<path:relpath>") @db.route("/extra/<path:relpath>")
def static_custom(relpath): def static_custom(relpath):
basepath = get_conf()['EXTRA_STATIC_PATH'] basepath = get_conf()["EXTRA_STATIC_PATH"]
if not basepath: if not basepath:
abort(405) abort(405)
fpath = os.path.join(basepath, relpath) fpath = os.path.join(basepath, relpath)
@ -259,4 +261,4 @@ def static_custom(relpath):
if not os.path.isfile(fpath): if not os.path.isfile(fpath):
abort(404, "File non trovato") abort(404, "File non trovato")
mime, _encoding = mimetypes.guess_type(fpath) mime, _encoding = mimetypes.guess_type(fpath)
return Response(open(fpath, 'rb').read(), mimetype=mime) return Response(open(fpath, "rb").read(), mimetype=mime)