Merge branch 'staging/maintenance' into maintenance
This commit is contained in:
commit
cc6c208899
8 files changed
+40
-21
No files matched your search
@@ -218,6 +218,8 @@ class AppKeysPlugin(
|
||||
@octoprint.plugin.BlueprintPlugin.route("/auth/<app_token>", methods=["GET"])
|
||||
@no_firstrun_access
|
||||
def handle_auth_dialog(self, app_token):
|
||||
from octoprint.server.util.csrf import add_csrf_cookie
|
||||
|
||||
user_id = current_user.get_name()
|
||||
required_user = flask.request.args.get("user", None)
|
||||
|
||||
@@ -256,7 +258,7 @@ class AppKeysPlugin(
|
||||
).replace("%(app)s", app_id),
|
||||
)
|
||||
)
|
||||
return add_non_caching_response_headers(response)
|
||||
return add_csrf_cookie(add_non_caching_response_headers(response))
|
||||
|
||||
@octoprint.plugin.BlueprintPlugin.route("/decision/<user_token>", methods=["POST"])
|
||||
@restricted_access
|
||||
|
||||
@@ -18,10 +18,10 @@ from octoprint.util.version import (
|
||||
)
|
||||
|
||||
SENTRY_URL_SERVER = (
|
||||
"https://11f9235bf2ac4f5d97f7e8bcb5be3783@o118517.ingest.sentry.io/1373987"
|
||||
"https://cb1ee590a2f34baca47dd207d7f294d5@o118517.ingest.sentry.io/1373987"
|
||||
)
|
||||
SENTRY_URL_COREUI = (
|
||||
"https://22fe071cb60c4dfcb8245a3712739f6e@o118517.ingest.sentry.io/1374096"
|
||||
"https://a32c80a4a282468d8d41fc2accb77088@o118517.ingest.sentry.io/1374096"
|
||||
)
|
||||
|
||||
SETTINGS_DEFAULTS = {
|
||||
|
||||
@@ -1420,8 +1420,9 @@ class Server:
|
||||
except octoprint.access.users.UnknownUser:
|
||||
pass
|
||||
|
||||
elif (
|
||||
default_language is not None
|
||||
if (
|
||||
not l10n
|
||||
and default_language is not None
|
||||
and not default_language == "_default"
|
||||
and default_language in LANGUAGES
|
||||
):
|
||||
@@ -1430,14 +1431,14 @@ class Server:
|
||||
|
||||
if l10n:
|
||||
# canonicalize and get rid of invalid language codes
|
||||
l10n_canoicalized = []
|
||||
l10n_canonicalized = []
|
||||
for x in l10n:
|
||||
try:
|
||||
l10n_canoicalized.append(str(Locale.parse(x)))
|
||||
l10n_canonicalized.append(str(Locale.parse(x)))
|
||||
except Exception:
|
||||
# invalid language code, ignore
|
||||
continue
|
||||
return Locale.negotiate(l10n_canoicalized, LANGUAGES)
|
||||
return Locale.negotiate(l10n_canonicalized, LANGUAGES)
|
||||
|
||||
# request: preference
|
||||
return Locale.parse(request.accept_languages.best_match(LANGUAGES, default="en"))
|
||||
|
||||
@@ -20,6 +20,7 @@ from flask import (
|
||||
send_from_directory,
|
||||
url_for,
|
||||
)
|
||||
from werkzeug.routing import BuildError
|
||||
|
||||
import octoprint.plugin
|
||||
from octoprint.access.permissions import OctoPrintPermission, Permissions
|
||||
@@ -195,8 +196,14 @@ def login():
|
||||
allowed_paths = [
|
||||
url_for("index"),
|
||||
url_for("recovery"),
|
||||
url_for("plugin.appkeys.handle_auth_dialog", app_token="*"),
|
||||
] + configured_allowed_paths
|
||||
]
|
||||
try:
|
||||
allowed_paths += [
|
||||
url_for("plugin.appkeys.handle_auth_dialog", app_token="*"),
|
||||
]
|
||||
except BuildError:
|
||||
pass # no appkeys plugin enabled, see #4763
|
||||
allowed_paths += configured_allowed_paths
|
||||
|
||||
if not validate_local_redirect(redirect_url, allowed_paths):
|
||||
_logger.warning(
|
||||
|
||||
@@ -290,7 +290,7 @@ $(function () {
|
||||
}
|
||||
}
|
||||
if (checks.lt !== undefined) {
|
||||
if (!(value < checks.gt)) {
|
||||
if (!(value < checks.lt)) {
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,12 +466,15 @@ $(function () {
|
||||
if (mark.label) {
|
||||
markLabel = gettext(mark.label);
|
||||
}
|
||||
if (o.left > yAxisLabelWidth) {
|
||||
var label = $("<div></div>");
|
||||
label.html(markLabel);
|
||||
label.addClass("temperature-mark-label");
|
||||
label.addClass("temperature-mark-type-" + mark.type);
|
||||
|
||||
// we create the label even if we don't show it so that we can query its
|
||||
// background color (see #4761)
|
||||
var label = $("<div></div>");
|
||||
label.html(markLabel);
|
||||
label.addClass("temperature-mark-label");
|
||||
label.addClass("temperature-mark-type-" + mark.type);
|
||||
|
||||
if (o.left > yAxisLabelWidth) {
|
||||
graph.append(label);
|
||||
|
||||
// draw markings label on the left if doesn't fit on the right
|
||||
|
||||
Reference in new issue
Block a user