Only use iter_items if you are sure it is used just once; fixed issue duplicating places

svn: r15673
This commit is contained in:
Doug Blank 2010-07-31 15:55:56 +00:00
parent 7ea1f71083
commit dc0d9511a3

View File

@ -909,10 +909,8 @@ class CSVParser(object):
return person
def get_or_create_place(self,place_name):
place_list = self.db.iter_place_handles()
LOG.debug("get_or_create_place: list: %s", list(place_list))
LOG.debug("get_or_create_place: looking for: %s", place_name)
for place_handle in place_list:
for place_handle in self.db.iter_place_handles():
place = self.db.get_place_from_handle(place_handle)
if place.get_title() == place_name:
return (0, place)