Commit d2588893 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

fix Provider creation from JSON

parent 93530c0f
......@@ -36,12 +36,15 @@ class APIResponseAdapter:
@staticmethod
def provider_from_dict(data: Dict) -> Provider:
"""Build Provider object from API JSON response."""
# Change empty ("") terms_of_use to None value
terms_of_use = data.get("terms_of_use")
terms_of_use = terms_of_use if terms_of_use else None
data = {
"code": data.get("code"),
"description": data.get("description"),
"name": data.get("name"),
"region": data.get("region"),
"terms_of_use": data.get("terms_of_use"),
"terms_of_use": terms_of_use,
"attribution": None,
"website": data.get("website"),
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment