Fixed bug where post data is None

This commit is contained in:
Rudi Grinberg 2012-10-30 16:16:02 -04:00
parent 959cb11bec
commit 4b526fe454
1 changed files with 3 additions and 2 deletions

View File

@ -83,8 +83,8 @@ class ApiRequest(object):
# TODO : get rid of god damn urllib and replace everything with
# grequests or requests at least
final_url = self.url.params(**kwargs).url()
post_data = urllib.urlencode(_post_data)
req = urllib2.Request(final_url, post_data)
if _post_data is not None: _post_data = urllib.urlencode(_post_data)
req = urllib2.Request(final_url, _post_data)
response = urllib2.urlopen(req).read()
return json.loads(response)
@ -549,6 +549,7 @@ class AirtimeApiClient(object):
def list_all_watched_dirs(self):
# Does this include the stor directory as well?
return self.services.list_all_watched_dirs()
logger = self.logger
try:
url = self.construct_url("list_all_watched_dirs")