Skip to content

Commit

Permalink
renamed ParseBase.execute body arg to avoid collisions
Browse files Browse the repository at this point in the history
workaround for #113
  • Loading branch information
dankrause committed Jun 22, 2015
1 parent a66533a commit 9c5bd49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions parse_rest/connection.py
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion parse_rest/datatypes.py
Expand Up @@ -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])
Expand Down

0 comments on commit 9c5bd49

Please sign in to comment.