From 4b526fe454797fbe9e7ef29f8d46c6d2cbfbe522 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 30 Oct 2012 16:16:02 -0400 Subject: [PATCH] Fixed bug where post data is None --- python_apps/api_clients/api_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index 846be3b8e..c7f94c150 100644 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -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")