diff --git a/helios_auth/auth_systems/linkedin.py b/helios_auth/auth_systems/linkedin.py index e50f19fdb..ac3140ecf 100644 --- a/helios_auth/auth_systems/linkedin.py +++ b/helios_auth/auth_systems/linkedin.py @@ -34,11 +34,7 @@ def _get_client_by_token(token): def get_auth_url(request, redirect_url): client = _get_new_client() - try: - tok = client.get_request_token() - except: - return None - + tok = client.get_request_token() request.session['request_token'] = tok url = client.get_authenticate_url(tok['oauth_token']) return url diff --git a/helios_auth/auth_systems/oauthclient/client.py b/helios_auth/auth_systems/oauthclient/client.py index 4980535e4..5e716ed66 100644 --- a/helios_auth/auth_systems/oauthclient/client.py +++ b/helios_auth/auth_systems/oauthclient/client.py @@ -55,28 +55,14 @@ def oauth_request(self, url, args=None, method=None): elif method == "POST": return self.http_wrapper(req.get_normalized_http_url(),req.to_postdata()) - #this is barely working. (i think. mostly it is that everyone else is using httplib) def http_wrapper(self, url, postdata=None): if postdata is None: postdata = {} - try: - if postdata != {}: - f = urllib.request.urlopen(url, postdata) - else: - f = urllib.request.urlopen(url) - response = f.read() - except: - import traceback - import logging, sys - cla, exc, tb = sys.exc_info() - logging.error(url) - if postdata: - logging.error("with post data") - else: - logging.error("without post data") - logging.error(exc.args) - logging.error(traceback.format_tb(tb)) - response = "" + if postdata != {}: + f = urllib.request.urlopen(url, postdata) + else: + f = urllib.request.urlopen(url) + response = f.read() return response