Skip to content

Commit

Permalink
Merge pull request #272 from hotosm/fix/notSetEnviron
Browse files Browse the repository at this point in the history
Check if key is set before trying to get value
  • Loading branch information
kshitijrajsharma authored Aug 29, 2024
2 parents bb83b34 + 73eda02 commit 8d3de47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/raw_backend
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def download_file(download_dir, source_path):
target_path = os.path.join(download_dir, filename)
if not os.path.exists(target_path):
print(f"\nStarting download for: {target_path}")
if os.environ["OSM_USERNAME"] and os.environ["OSM_PASSWORD"]:
if "OSM_USERNAME" in os.environ and os.environ["OSM_USERNAME"] and \
"OSM_PASSWORD" in os.environ and os.environ["OSM_PASSWORD"]:
cookies = verify_me_osm(
os.environ["OSM_USERNAME"], os.environ["OSM_PASSWORD"]
)
Expand Down

0 comments on commit 8d3de47

Please sign in to comment.