Skip to content

Commit

Permalink
api: fix double defaulting of cache_path
Browse files Browse the repository at this point in the history
Set `cache_path` only if it's actually defined, setting it to `None`
will result the next default to take `None` as the actual value, instead
of defaulting to `Path.pwd()`.

Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Mar 20, 2022
1 parent b85a0c7 commit 8fd12b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion asu/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ def api_build_post():
return response, status

req["store_path"] = current_app.config["STORE_PATH"]
req["cache_path"] = current_app.config.get("CACHE_PATH")
if current_app.config.get("CACHE_PATH"):
req["cache_path"] = current_app.config.get("CACHE_PATH")
req["upstream_url"] = current_app.config["UPSTREAM_URL"]
req["branch_data"] = current_app.config["BRANCHES"][req["branch"]]
req["request_hash"] = request_hash
Expand Down

0 comments on commit 8fd12b8

Please sign in to comment.