Skip to content

Commit 12a68cd

Browse files
authored
Merge pull request #464 from DarrenZal/fix/unbound-headers-push-clonedb
Fix UnboundLocalError in push() and clonedb() without remote auth
2 parents d6cd65a + 67fd90a commit 12a68cd

2 files changed

Lines changed: 16 additions & 18 deletions

File tree

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terminusdb_client/client/Client.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,14 +2083,13 @@ def push(
20832083
"author": author,
20842084
"message": message,
20852085
}
2086+
headers = {}
20862087
if self._remote_auth_dict or remote_auth:
2087-
headers = {
2088-
"Authorization-Remote": (
2089-
self._generate_remote_header(remote_auth)
2090-
if remote_auth
2091-
else self._remote_auth()
2092-
)
2093-
}
2088+
headers["Authorization-Remote"] = (
2089+
self._generate_remote_header(remote_auth)
2090+
if remote_auth
2091+
else self._remote_auth()
2092+
)
20942093
headers.update(self._default_headers)
20952094

20962095
result = self._session.post(
@@ -2619,14 +2618,13 @@ def clonedb(
26192618
if description is None:
26202619
description = f"New database {newid}"
26212620

2621+
headers = {}
26222622
if self._remote_auth_dict or remote_auth:
2623-
headers = {
2624-
"Authorization-Remote": (
2625-
self._generate_remote_header(remote_auth)
2626-
if remote_auth
2627-
else self._remote_auth()
2628-
)
2629-
}
2623+
headers["Authorization-Remote"] = (
2624+
self._generate_remote_header(remote_auth)
2625+
if remote_auth
2626+
else self._remote_auth()
2627+
)
26302628
headers.update(self._default_headers)
26312629
rc_args = {"remote_url": clone_source, "label": newid, "comment": description}
26322630

0 commit comments

Comments
 (0)