Skip to content

Commit

Permalink
fixing environmental vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Jürgen Krauß committed Jul 11, 2024
1 parent 6e18ce7 commit 3e81ab8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
19 changes: 12 additions & 7 deletions job-api/job_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
from pathlib import Path

class JobFetcher:
client_id:str|None
password:str|None
api_path:str|None
base_url:str|None = "https://api.softgarden.io"

def __init__(self, csv_path = None, client_id = None, password = None, api_path = None):
self.client_id = client_id # os.getenv("CLIENT_ID")
self.password = password # os.getenv("PASSWORD")
self.api_path = api_path # os.getenv("API_PATH")
self.base_url = "https://api.softgarden.io"
self.client_id = client_id
self.password = password
self.api_path = api_path

if not all([self.client_id, self.password, self.api_path, self.base_url]):
raise ValueError('Check your .env variables!')

Check failure on line 17 in job-api/job_fetcher.py

View workflow job for this annotation

GitHub Actions / generate-jobs

Check your .env variables!

self.job_or_trainee_mappings = {
"2": "Auszubildendenstelle",
"6": "Festanstellung",
Expand All @@ -26,9 +34,6 @@ def __init__(self, csv_path = None, client_id = None, password = None, api_path
"1b4f51fe628c4119a2d7a581557d0944": "mit Berufserfahrung"
}

if not all([self.client_id, self.password, self.api_path]):
raise ValueError('Check your .env variables!')

if csv_path is None:
p = Path(__file__).parent.resolve()
csv_path = p / "jobs.csv"
Expand Down
6 changes: 3 additions & 3 deletions job-api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
p = Path(__file__).parent.resolve()
jf = job_fetcher.JobFetcher(
p / "jobs.csv",
os.getenv("CLIENT_ID"),
os.getenv("PASSWORD"),
os.getenv("API_PATH")
os.environ.get("CLIENT_ID"),
os.environ.get("PASSWORD"),
os.environ.get("API_PATH")
)
converter = markdown_converter.JobMarkdownConverter(p / "jobs.csv")
ftp = ftp_uploader.FTPUploader(
Expand Down

0 comments on commit 3e81ab8

Please sign in to comment.