Skip to content

Commit

Permalink
refacto: "EVENTS_DOMAIN" var in Python code
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jan 15, 2024
1 parent d896c2e commit 83e6938
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions helpers/config_models/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@


class ApiModel(BaseModel):
events_domain: str = environ["EVENTS_DOMAIN"]
root_path: str = ""
version: str = Field(default=environ["VERSION"], frozen=True)
6 changes: 2 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@
)
db = sqlite3.connect(".local.sqlite", check_same_thread=False)

EVENTS_DOMAIN = environ.get("EVENTS_DOMAIN").strip("/")
assert EVENTS_DOMAIN, "EVENTS_DOMAIN environment variable is not set"
CALL_EVENT_URL = f"{EVENTS_DOMAIN}/call/event"
CALL_INBOUND_URL = f"{EVENTS_DOMAIN}/call/inbound"
CALL_EVENT_URL = f"{CONFIG.api.events_domain}/call/event"
CALL_INBOUND_URL = f"{CONFIG.api.events_domain}/call/inbound"


class Context(str, Enum):
Expand Down

0 comments on commit 83e6938

Please sign in to comment.