From 9c5bd490e14f89e1b13d3b39b4dada3a7400e6c4 Mon Sep 17 00:00:00 2001 From: Dan Krause Date: Mon, 22 Jun 2015 09:23:18 -0400 Subject: [PATCH] renamed ParseBase.execute body arg to avoid collisions workaround for #113 --- parse_rest/connection.py | 6 +++--- parse_rest/datatypes.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parse_rest/connection.py b/parse_rest/connection.py index eac0310..5ac2d9c 100644 --- a/parse_rest/connection.py +++ b/parse_rest/connection.py @@ -67,7 +67,7 @@ class ParseBase(object): ENDPOINT_ROOT = API_ROOT @classmethod - def execute(cls, uri, http_verb, extra_headers=None, batch=False, body=None, **kw): + def execute(cls, uri, http_verb, extra_headers=None, batch=False, _body=None, **kw): """ if batch == False, execute a command with the given parameters and return the response JSON. @@ -88,10 +88,10 @@ def execute(cls, uri, http_verb, extra_headers=None, batch=False, body=None, **k master_key = ACCESS_KEYS.get('master_key') url = uri if uri.startswith(API_ROOT) else cls.ENDPOINT_ROOT + uri - if body is None: + if _body is None: data = kw and json.dumps(kw, default=date_handler) or "{}" else: - data = body + data = _body if http_verb == 'GET' and data: url += '?%s' % urlencode(kw) data = None diff --git a/parse_rest/datatypes.py b/parse_rest/datatypes.py index d77e0b0..1930d80 100644 --- a/parse_rest/datatypes.py +++ b/parse_rest/datatypes.py @@ -225,7 +225,7 @@ def save(self, batch=False): raise ParseError("Files can't be overwritten") uri = '/'.join([self.__class__.ENDPOINT_ROOT, self.name]) headers = {'Content-type': self.mimetype} - response = self.__class__.POST(uri, extra_headers=headers, batch=batch, body=self._content) + response = self.__class__.POST(uri, extra_headers=headers, batch=batch, _body=self._content) self._file_url = response['url'] self._name = response['name'] self._api_url = '/'.join([API_ROOT, 'files', self._name])