diff --git a/boards/management/commands/sync_with_server.py b/boards/management/commands/sync_with_server.py --- a/boards/management/commands/sync_with_server.py +++ b/boards/management/commands/sync_with_server.py @@ -43,7 +43,6 @@ class Command(BaseCommand): local_id=local_id) xml = GlobalId.objects.generate_request_get([global_id]) - # body = urllib.parse.urlencode(data) h = httplib2.Http() response, content = h.request(get_url, method="POST", body=xml) @@ -51,12 +50,11 @@ class Command(BaseCommand): else: raise Exception('Invalid global ID') else: + print('Running LIST request') h = httplib2.Http() xml = GlobalId.objects.generate_request_list() response, content = h.request(list_url, method="POST", body=xml) - print(content.decode() + '\n') - root = ET.fromstring(content) status = root.findall('status')[0].text if status == 'success': @@ -79,8 +77,8 @@ class Command(BaseCommand): limit = options.get('split_query', len(ids_to_sync)) for offset in range(0, len(ids_to_sync), limit): xml = GlobalId.objects.generate_request_get(ids_to_sync[offset:offset+limit]) - # body = urllib.parse.urlencode(data) h = httplib2.Http() + print('Running GET request') response, content = h.request(get_url, method="POST", body=xml) SyncManager.parse_response_get(content, file_url)