File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,22 @@ def validate_and_get_xml_version_from_root(root: xmlElement) -> Tuple[Optional[V
72
72
# Fallback to validate the legacy 'version' field
73
73
try :
74
74
xml_version = parse (unparsed_root_version )
75
- return xml_version , []
75
+
76
76
except ValueError :
77
77
logger .info ('Import failed: Invalid "version" format in XML (%s)' , unparsed_root_version )
78
78
errors = [_ ('The "version" attribute in this RDMO XML file is not a valid version.' )]
79
79
return None , errors
80
80
81
+ # RDMO 1.x can not import XMLs from RDMO 2.x
82
+ if rdmo_version < parse ('2.0.0' ) and xml_version >= parse ('2.0.0' ):
83
+ logger .info ('Import failed: Backwards compatibility is not supported for RDMO versions < 2.0.0' )
84
+ errors = [
85
+ _ ('This RDMO XML file was created with a newer version of RDMO and cannot be imported.' ),
86
+ _ ('Backwards compatibility is not supported for RDMO versions lower than 2.0.0.' )
87
+ ]
88
+ return None , errors
89
+
90
+ return xml_version , []
81
91
82
92
def validate_legacy_elements (elements : dict , root_version : Version ) -> list :
83
93
You can’t perform that action at this time.
0 commit comments