From d5cd19d490e9b7e4ddf21cdebc1b8f4f8852fad4 Mon Sep 17 00:00:00 2001 From: lpm0073 Date: Tue, 4 Oct 2022 09:33:05 -0500 Subject: [PATCH] lint --- wp_oauth_backend/wp_oauth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp_oauth_backend/wp_oauth.py b/wp_oauth_backend/wp_oauth.py index 7440049..2277849 100644 --- a/wp_oauth_backend/wp_oauth.py +++ b/wp_oauth_backend/wp_oauth.py @@ -22,6 +22,9 @@ class StepwiseMathWPOAuth2(BaseOAuth2): """ WP OAuth authentication backend customized for Open edX """ + # private utility function. not part of psa. + def _urlopen(self, url): + return urlopen(url).read().decode("utf-8") # https://python-social-auth.readthedocs.io/en/latest/configuration/settings.html @@ -162,13 +165,10 @@ class StepwiseMathWPOAuth2(BaseOAuth2): logger.info("user_data() url: {url}".format(url=url)) try: - response = json.loads(self.urlopen(url)) + response = json.loads(self._urlopen(url)) user_details = self.get_user_details(response) return user_details except ValueError as e: logger.error('user_data() did not work: {err}'.format(err=e)) return None - # utility function. not part of psa. - def urlopen(self, url): - return urlopen(url).read().decode("utf-8")