diff --git a/portal_client/client_application_uploader.py b/portal_client/client_application_uploader.py index 07ba41f..cbb84ce 100755 --- a/portal_client/client_application_uploader.py +++ b/portal_client/client_application_uploader.py @@ -57,7 +57,7 @@ def set_version_as_current(self, slug, version): return requests.patch( urljoin(self.base_url, f"{slug}/"), data={"current_version": version}, - headers={"Authorization": self.get_authorization_header()}, + headers={"Authorization": get_authorization_header()}, ) diff --git a/portal_client/utils.py b/portal_client/utils.py index daab2d2..8914148 100644 --- a/portal_client/utils.py +++ b/portal_client/utils.py @@ -6,14 +6,14 @@ def get_authorization_header(): if os.getenv("PORTAL_BACKEND_ACCESS_TOKEN"): return "Bearer %s" % os.getenv("PORTAL_BACKEND_ACCESS_TOKEN") - if os.getenv("POTAL_BACKEND_USERNAME") and os.getenv("POTAL_BACKEND_PASSWORD"): + if os.getenv("PORTAL_BACKEND_USERNAME") and os.getenv("PORTAL_BACKEND_PASSWORD"): return "Basic {}".format( b64encode( bytes( "%s:%s" % ( - os.getenv("POTAL_BACKEND_USERNAME"), - os.getenv("POTAL_BACKEND_PASSWORD"), + os.getenv("PORTAL_BACKEND_USERNAME"), + os.getenv("PORTAL_BACKEND_PASSWORD"), ), "utf-8", ) @@ -21,5 +21,5 @@ def get_authorization_header(): ) raise Exception( - "Missing authentication! Please specify either PORTAL_BACKEND_ACCESS_TOKEN or POTAL_BACKEND_USERNAME and POTAL_BACKEND_PASSWORD" + "Missing authentication! Please specify either PORTAL_BACKEND_ACCESS_TOKEN or PORTAL_BACKEND_USERNAME and PORTAL_BACKEND_PASSWORD" )