diff --git a/rattail_nationbuilder/importing/nationbuilder.py b/rattail_nationbuilder/importing/nationbuilder.py index 00d3d59..22306b0 100644 --- a/rattail_nationbuilder/importing/nationbuilder.py +++ b/rattail_nationbuilder/importing/nationbuilder.py @@ -103,7 +103,8 @@ class NationBuilderCachePersonImporter(FromNationBuilder, nationbuilder_importin ] + primary_address_fields def get_host_objects(self): - return self.nationbuilder.get_people(page_size=500) + return self.nationbuilder.get_people(page_size=100, + progress=self.progress) def normalize_host_object(self, person): diff --git a/rattail_nationbuilder/nationbuilder/webapi.py b/rattail_nationbuilder/nationbuilder/webapi.py index 019db08..82a02da 100644 --- a/rattail_nationbuilder/nationbuilder/webapi.py +++ b/rattail_nationbuilder/nationbuilder/webapi.py @@ -95,6 +95,10 @@ class NationBuilderWebAPI(object): https://apiexplorer.nationbuilder.com/nationbuilder#People """ + # nb. found this limit in practice, but it is not documented?! + if page_size > 100: + raise ValueError("page_size cannot be more than 100") + response = self.get('/api/v1/people/count') count = response.json()['people_count'] pages = count // page_size