Skip to content

Commit

Permalink
Fix Place init with empty admin_divisions
Browse files Browse the repository at this point in the history
This fixes creation of a place without admin divisions.

https://trello.com/c/obt1kGbN
  • Loading branch information
Nagyman committed May 22, 2015
1 parent 59f560e commit e36f641
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
History
-------

0.1.43 (2015-04-29)
-------------------

* Fixed `Place` init with empty admin_divisions


0.1.42 (2015-04-29)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion gapipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

__version__ = '0.1.42'
__version__ = '0.1.43'
__title__ = 'gapipy'


Expand Down
2 changes: 1 addition & 1 deletion gapipy/resources/geo/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def _set_admin_divisions(self):
corresponding Place (stub) instances.
"""
if 'admin_divisions' in self._raw_data:
raw_admin_divisions = self._raw_data['admin_divisions']
raw_admin_divisions = self._raw_data['admin_divisions'] or []
admin_divisions = [self.__class__(d, stub=True) for d in raw_admin_divisions]
self.admin_divisions = admin_divisions

0 comments on commit e36f641

Please sign in to comment.