diff options
author | Remco Burema <r.burema@ultimaker.com> | 2021-04-16 19:17:04 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2021-04-16 19:17:04 +0300 |
commit | f22e223d72c1aba95306124d8936844b6ed35031 (patch) | |
tree | 67583a8c05bfde71a28674a42ef66f493a9d280c /plugins/VersionUpgrade | |
parent | b3c03b877114f1ea6b81e105a8dcca0c252b07b1 (diff) | |
parent | 4bf440b86efef17a535299b93e82b3baefcaf16f (diff) |
Merge branch 'master' into libArachne_rebased
Diffstat (limited to 'plugins/VersionUpgrade')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py index 5ce3cb724f..4595e66ed3 100644 --- a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py +++ b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py @@ -4,8 +4,10 @@ import configparser from typing import Tuple, List import io +import json from UM.VersionUpgrade import VersionUpgrade +from cura.API import Account class VersionUpgrade48to49(VersionUpgrade): @@ -32,6 +34,13 @@ class VersionUpgrade48to49(VersionUpgrade): if "categories_expanded" in parser["cura"] and any([setting in parser["cura"]["categories_expanded"] for setting in self._moved_visibility_settings]): parser["cura"]["categories_expanded"] += ";top_bottom" + # If the account scope in 4.8 is outdated, delete it so that the user is enforced to log in again and get the + # correct permissions. + if "ultimaker_auth_data" in parser["general"]: + ultimaker_auth_data = json.loads(parser["general"]["ultimaker_auth_data"]) + if set(Account.CLIENT_SCOPES.split(" ")) - set(ultimaker_auth_data["scope"].split(" ")): + parser["general"]["ultimaker_auth_data"] = "{}" + result = io.StringIO() parser.write(result) return [filename], [result.getvalue()] |