diff --git a/larigira/dbadmin/__init__.py b/larigira/dbadmin/__init__.py index e5c1c1c..940cedf 100644 --- a/larigira/dbadmin/__init__.py +++ b/larigira/dbadmin/__init__.py @@ -126,8 +126,10 @@ def edit_time(alarmid): "add_time_kind.html", form=form, kind=kind, mode="edit", alarmid=alarmid ) + 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/", methods=["GET", "POST"]) def addtime_kind(kind): @@ -249,9 +251,9 @@ def delete_alarm(alarmid): return redirect(url_for("db.events_list")) -@db.route("/quick/") +@db.route("/extra/") def static_custom(relpath): - basepath = get_conf()['EXTRA_STATIC_PATH'] + basepath = get_conf()["EXTRA_STATIC_PATH"] if not basepath: abort(405) fpath = os.path.join(basepath, relpath) @@ -259,4 +261,4 @@ def static_custom(relpath): if not os.path.isfile(fpath): abort(404, "File non trovato") mime, _encoding = mimetypes.guess_type(fpath) - return Response(open(fpath, 'rb').read(), mimetype=mime) + return Response(open(fpath, "rb").read(), mimetype=mime)