We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f4b4a2d + f394750 commit 509e0eaCopy full SHA for 509e0ea
rdmo/projects/imports.py
@@ -92,13 +92,15 @@ class RDMOXMLImport(Import):
92
'application/xml': ['.xml']
93
}
94
95
- def check(self):
+ def check(self) -> bool:
96
file_type, encoding = mimetypes.guess_type(self.file_name)
97
- if file_type == 'application/xml' or file_type == 'text/xml':
+ if file_type in ('application/xml', 'text/xml'):
98
self.root = read_xml_file(self.file_name)
99
- if self.root and self.root.tag == 'project':
+ if self.root is not None and self.root.tag == 'project':
100
self.ns_map = get_ns_map(self.root)
101
return True
102
+ return False
103
+
104
105
def process(self):
106
if self.current_project is None:
0 commit comments