Traceback (most recent call last):
File "scripts/merge_leads.py", line 206, in <module>
pbar.update(pbar.currval + len(leads))
File "/home/sam/sources/closeio-api/venv/local/lib/python2.7/site-packages/progressbar/progressbar.py", line 252, in update
raise ValueError('Value out of range')
ValueError: Value out of range
Added a bit of logging and I could see that in the first iteration it found 1371 leads:
2016-10-17 15:30:26,676 - closeio.api.merge_leads - INFO - Total Leads: (1371), Offset: (0)
Then at some point it tries to update from 1300 with 100 and thus value out of range.
python scripts/merge_leads.py --field email -k API_KEY
Added a bit of logging and I could see that in the first iteration it found 1371 leads:
2016-10-17 15:30:26,676 - closeio.api.merge_leads - INFO - Total Leads: (1371), Offset: (0)
Then at some point it tries to update from 1300 with 100 and thus value out of range.
2016-10-17 15:40:29,934 - closeio.api.merge_leads - INFO - Currval: (1300), len(leads) (100)
Is this assumption correct
total_leads = resp['total_results']
?