Skip to content

Commit

Permalink
Merge pull request #39 from alneberg/dotenv_fix
Browse files Browse the repository at this point in the history
Moved dotenv loading inside config init since it didn't work as it was.
  • Loading branch information
aanil authored May 6, 2024
2 parents 4d480be + d2b2737 commit d19b4e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions daily_read/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# Installed
import click
from dateutil.relativedelta import relativedelta
import dotenv
from rich.logging import RichHandler

# Own
Expand All @@ -22,7 +21,6 @@
import daily_read.utils


dotenv.load_dotenv()
config_values = daily_read.config.Config()

rich_handler = RichHandler()
Expand Down
3 changes: 3 additions & 0 deletions daily_read/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import os

import dotenv


class Config(object):
def __init__(self):
dotenv.load_dotenv()
self.ORDER_PORTAL_URL = os.getenv("DAILY_READ_ORDER_PORTAL_URL")
self.ORDER_PORTAL_API_KEY = os.getenv("DAILY_READ_ORDER_PORTAL_API_KEY")
self.REPORTS_LOCATION = os.getenv("DAILY_READ_REPORTS_LOCATION")
Expand Down

0 comments on commit d19b4e7

Please sign in to comment.