Skip to content

Commit

Permalink
do not init settings on import 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Dec 10, 2024
1 parent 6609f5a commit 29d1661
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/edutap/wallet_google/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
class HTTPRecorder(HTTPAdapter):
"""Record the HTTP requests and responses to a file."""

def __init__(self, settings: GoogleWalletSettings):
super().__init__()

@property
def settings(self) -> GoogleWalletSettings:
settings = getattr(self, "_settings", None)
Expand Down Expand Up @@ -54,8 +51,12 @@ class SessionManager:
Sessions here are thread safe.
"""

def __init__(self):
self.settings = GoogleWalletSettings()
@property
def settings(self) -> GoogleWalletSettings:
settings = getattr(self, "_settings", None)
if settings is None:
self._settings = GoogleWalletSettings()
return self._settings

def _make_session(self) -> AuthorizedSession:
if not self.settings.credentials_file.exists:
Expand Down

0 comments on commit 29d1661

Please sign in to comment.