From fbd43deb145b801fbff9a42f2c9ccbaf3b995aad Mon Sep 17 00:00:00 2001 From: Cory Zue Date: Fri, 26 Jun 2020 09:45:22 +0200 Subject: [PATCH] don't modify params in place https://dimagi-dev.atlassian.net/browse/SUPPORT-2519 --- commcare_export/commcare_hq_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commcare_export/commcare_hq_client.py b/commcare_export/commcare_hq_client.py index b1421c92..0761532b 100644 --- a/commcare_export/commcare_hq_client.py +++ b/commcare_export/commcare_hq_client.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes +import copy import logging from collections import OrderedDict @@ -138,7 +139,7 @@ def iterate_resource(resource=resource, params=params): raise ResourceRepeatException("Requested resource '{}' {} times with same parameters".format(resource, repeat_counter)) batch = self.get(resource, params) - last_params = params + last_params = copy.copy(params) if not total_count or total_count == 'unknown' or fetched >= total_count: total_count = int(batch['meta']['total_count']) if batch['meta']['total_count'] else 'unknown' fetched = 0