diff --git a/.versioneer-lookup b/.versioneer-lookup index a1e00aaed..182f06954 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -29,10 +29,10 @@ improve/.* 1.10.0 cd955e9a46782119b36cc22b8dea5652ebbf9774 pep440-dev staging/bugfix 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev bug/.* 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev -# staging/maintenance is currently the branch for preparation of 1.9.0rc3 +# staging/maintenance is currently the branch for preparation of 1.9.0rc4 # so is regressionfix/... -staging/maintenance 1.9.0rc3 95e87eb1970d8e322738f9698c9d665d78f2d74e pep440-dev -regressionfix/.* 1.9.0rc3 95e87eb1970d8e322738f9698c9d665d78f2d74e pep440-dev +staging/maintenance 1.9.0rc4 ed798e4c6f473ed15bfd8ff583f3913b18ab716c pep440-dev +regressionfix/.* 1.9.0rc4 ed798e4c6f473ed15bfd8ff583f3913b18ab716c pep440-dev # staging/devel is currently inactive (but has the 1.4.1rc4 namespace) staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev diff --git a/setup.py b/setup.py index b989800a3..968013229 100644 --- a/setup.py +++ b/setup.py @@ -201,11 +201,17 @@ class ScanDepsCommand(setuptools.Command): ) resp.raise_for_status() + def safe_parse_version(version): + try: + return parse_version(version) + except ValueError: + return None + data = resp.json() versions = list( filter( - lambda x: not x.is_prerelease and not x.is_devrelease, - map(lambda x: parse_version(x), data.get("versions", [])), + lambda x: x and not x.is_prerelease and not x.is_devrelease, + map(lambda x: safe_parse_version(x), data.get("versions", [])), ) ) if not versions: diff --git a/src/octoprint/plugins/appkeys/__init__.py b/src/octoprint/plugins/appkeys/__init__.py index bc3a396cc..e4f275734 100644 --- a/src/octoprint/plugins/appkeys/__init__.py +++ b/src/octoprint/plugins/appkeys/__init__.py @@ -218,6 +218,8 @@ class AppKeysPlugin( @octoprint.plugin.BlueprintPlugin.route("/auth/", 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/", methods=["POST"]) @restricted_access diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py index 9008c9b9f..dcd59658b 100644 --- a/src/octoprint/plugins/errortracking/__init__.py +++ b/src/octoprint/plugins/errortracking/__init__.py @@ -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 = { diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index d88cc672e..f0da8dc83 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -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")) diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py index 92211021e..025fcb231 100644 --- a/src/octoprint/server/views.py +++ b/src/octoprint/server/views.py @@ -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( diff --git a/src/octoprint/static/js/app/viewmodels/printerprofiles.js b/src/octoprint/static/js/app/viewmodels/printerprofiles.js index bc79621f4..d55fd99ef 100644 --- a/src/octoprint/static/js/app/viewmodels/printerprofiles.js +++ b/src/octoprint/static/js/app/viewmodels/printerprofiles.js @@ -290,7 +290,7 @@ $(function () { } } if (checks.lt !== undefined) { - if (!(value < checks.gt)) { + if (!(value < checks.lt)) { return def; } } diff --git a/src/octoprint/static/js/app/viewmodels/temperature.js b/src/octoprint/static/js/app/viewmodels/temperature.js index 538d1de71..4d0814fb8 100644 --- a/src/octoprint/static/js/app/viewmodels/temperature.js +++ b/src/octoprint/static/js/app/viewmodels/temperature.js @@ -466,12 +466,15 @@ $(function () { if (mark.label) { markLabel = gettext(mark.label); } - if (o.left > yAxisLabelWidth) { - var label = $("
"); - 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 = $("
"); + 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