folio-data-import 0.2.3__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of folio-data-import might be problematic. Click here for more details.
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/PKG-INFO +1 -1
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/pyproject.toml +1 -1
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/src/folio_data_import/UserImport.py +7 -5
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/LICENSE +0 -0
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/README.md +0 -0
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/src/folio_data_import/MARCDataImport.py +0 -0
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/src/folio_data_import/__init__.py +0 -0
- {folio_data_import-0.2.3 → folio_data_import-0.2.4}/src/folio_data_import/__main__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "folio_data_import"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.4"
|
|
4
4
|
description = "A python module to interact with the data importing capabilities of the open-source FOLIO ILS"
|
|
5
5
|
authors = ["Brooks Travis <brooks.travis@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -181,12 +181,15 @@ class UserImporter: # noqa: R0902
|
|
|
181
181
|
KeyError: If an address type name in the user object is not found in address_type_map.
|
|
182
182
|
|
|
183
183
|
"""
|
|
184
|
-
if "personal" in user_obj
|
|
185
|
-
|
|
184
|
+
if "personal" in user_obj:
|
|
185
|
+
addresses = user_obj["personal"].pop("addresses", [])
|
|
186
|
+
mapped_addresses = []
|
|
187
|
+
for address in addresses:
|
|
186
188
|
try:
|
|
187
189
|
address["addressTypeId"] = self.address_type_map[
|
|
188
190
|
address["addressTypeId"]
|
|
189
191
|
]
|
|
192
|
+
mapped_addresses.append(address)
|
|
190
193
|
except KeyError:
|
|
191
194
|
if address["addressTypeId"] not in self.address_type_map.values():
|
|
192
195
|
print(
|
|
@@ -197,9 +200,8 @@ class UserImporter: # noqa: R0902
|
|
|
197
200
|
f"Row {line_number}: Address type {address['addressTypeId']} not found"
|
|
198
201
|
f", removing address\n"
|
|
199
202
|
)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
del user_obj["personal"]["addresses"]
|
|
203
|
+
if mapped_addresses:
|
|
204
|
+
user_obj["personal"]["addresses"] = mapped_addresses
|
|
203
205
|
|
|
204
206
|
async def map_patron_groups(self, user_obj, line_number) -> None:
|
|
205
207
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|