diff --git a/geonode/storage/data_retriever.py b/geonode/storage/data_retriever.py index 9e467c66341..68a14c2e864 100644 --- a/geonode/storage/data_retriever.py +++ b/geonode/storage/data_retriever.py @@ -211,7 +211,8 @@ def _unzip(self, zip_name: str) -> Mapping: available_choices = get_allowed_extensions() not_main_files = ["xml", "sld", "zip", "kmz"] base_file_choices = [x for x in available_choices if x not in not_main_files] - for _file in Path(self.temporary_folder).iterdir(): + sorted_files = sorted(Path(self.temporary_folder).iterdir()) + for _file in sorted_files: if not zipfile.is_zipfile(str(_file)): if any([_file.name.endswith(_ext) for _ext in base_file_choices]): self.file_paths["base_file"] = Path(str(_file))