Skip to content

Commit

Permalink
fix undefined headers var
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Nov 27, 2023
1 parent deb44a7 commit a7c1f8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mpcontribs-client/mpcontribs/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ def _run_futures(futures, total: int = 0, timeout: int = -1, desc=None, disable=
@functools.lru_cache(maxsize=1000)
def _load(protocol, host, headers_json, project, version):
spec_dict = _raw_specs(protocol, host, version)
headers = ujson.loads(headers_json)

if not spec_dict["paths"]:
url = f"{protocol}://{host}"
origin_url = f"{url}/apispec.json"
Expand All @@ -664,7 +666,6 @@ def _load(protocol, host, headers_json, project, version):
return swagger_spec

# retrieve list of projects accessible to user
headers = ujson.loads(headers_json)
query = {"name": project} if project else {}
query["_fields"] = ["name"]
url = f"{protocol}://{host}"
Expand Down

0 comments on commit a7c1f8c

Please sign in to comment.