From 3b6cc9bea79ef071cf53355c4b8ef91bed9e1e8f Mon Sep 17 00:00:00 2001 From: acostapazo Date: Wed, 6 Sep 2023 10:41:37 +0200 Subject: [PATCH 1/2] fix(config): check onboarding_url when enviroment is default (Environment.PRODUCTION) --- alice/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alice/config.py b/alice/config.py index 6d3fecc..6d07484 100644 --- a/alice/config.py +++ b/alice/config.py @@ -33,7 +33,7 @@ class Config(BaseSettings): @model_validator(mode="after") def validate_urls(self) -> "Config": - if self.environment is None: + if self.environment is None or self.environment == Environment.PRODUCTION: if isinstance(self.onboarding_url, str): if "sandbox" in self.onboarding_url: self.environment = Environment.SANDBOX From d640a1390fbce49f226dc5c6511a0fa403adb834 Mon Sep 17 00:00:00 2001 From: acostapazo Date: Wed, 6 Sep 2023 10:46:58 +0200 Subject: [PATCH 2/2] fix(config): static analysis --- alice/config.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/alice/config.py b/alice/config.py index 6d07484..8ffc651 100644 --- a/alice/config.py +++ b/alice/config.py @@ -40,10 +40,7 @@ def validate_urls(self) -> "Config": elif "staging" in self.onboarding_url: self.environment = Environment.STAGING else: - if self.environment == Environment.PRODUCTION: - self.onboarding_url = "https://apis.alicebiometrics.com/onboarding" - self.sandbox_url = "https://apis.alicebiometrics.com/onboarding/sandbox" - elif self.environment == Environment.SANDBOX: + if self.environment == Environment.SANDBOX: self.onboarding_url = ( "https://apis.sandbox.alicebiometrics.com/onboarding" )