Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Commit 2e75cb6

Browse files
authored
Merge pull request #265 from CSCfi/CSCMETAX-61-load-initial-data-fix
CSCMETAX-61: [FIX] Try a fix to an error in initial data loading duri…
2 parents a7d893a + 253f3f4 commit 2e75cb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/metax_api/management/commands/loadinitialdata.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def _load_data_catalogs(self):
100100
except:
101101
raise CommandError(response.content)
102102

103-
if self._error_is_already_exists(errors['catalog_json']):
103+
if self._error_is_already_exists(errors.get('catalog_json', {})):
104104
self.stdout.write('Catalog %s already exists, updating instead...' %
105105
dc['catalog_json']['identifier'])
106106

@@ -139,7 +139,7 @@ def _load_file_storages(self):
139139
errors = response.json()
140140
except:
141141
raise CommandError(response.content)
142-
if self._error_is_already_exists(errors['file_storage_json']):
142+
if self._error_is_already_exists(errors.get('file_storage_json', {})):
143143
self.stdout.write('File storage %s already exists, updating instead...' %
144144
fs['file_storage_json']['identifier'])
145145

0 commit comments

Comments
 (0)