Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion portal_client/client_application_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()},
)


Expand Down
8 changes: 4 additions & 4 deletions portal_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ 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",
)
).decode("ascii")
)

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"
)