Skip to content

Commit

Permalink
Merge pull request #178 from whole-tale/datamap
Browse files Browse the repository at this point in the history
Ensure that optional parameters in DataMap are REALLY optional
  • Loading branch information
Xarthisius authored Nov 25, 2018
2 parents 86fa180 + f97d417 commit abaa198
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/lib/data_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def toDict(self) -> Dict:

@staticmethod
def fromDict(d: Dict):
return DataMap(d['dataId'], d['size'], repository=d['repository'], doi=d['doi'],
name=d['name'])
return DataMap(
d['dataId'], d.get('size', 0), repository=d['repository'], doi=d.get('doi'),
name=d.get('name', 'Unknown Dataset'))

@staticmethod
def fromList(d: List[Dict]):
Expand Down

0 comments on commit abaa198

Please sign in to comment.