From a0d3dae92057d745508ec8d8c9c869f2b7532182 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Fri, 18 May 2018 10:07:20 +0200 Subject: [PATCH] Do not allow restore different version --- cura/Backups/Backup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cura/Backups/Backup.py b/cura/Backups/Backup.py index 5beefb0a1f..69718dd7c9 100644 --- a/cura/Backups/Backup.py +++ b/cura/Backups/Backup.py @@ -14,6 +14,7 @@ from UM.Logger import Logger from UM.Message import Message from UM.Platform import Platform from UM.Resources import Resources +from UM.Version import Version from cura.CuraApplication import CuraApplication @@ -116,7 +117,12 @@ class Backup: "Tried to restore a Cura backup without having proper data or meta data.")) return False - # TODO: handle restoring older data version. + current_version = CuraApplication.getInstance().getVersion() + version_to_restore = self.meta_data.get("cura_release", "master") + if current_version != version_to_restore: + # Cannot restore version older or newer than current because settings might have changed. + # Restoring this will cause a lot of issues so we don't allow this for now. + return False version_data_dir = Resources.getDataStoragePath() archive = ZipFile(io.BytesIO(self.zip_file), "r")