diff options
Diffstat (limited to 'jb/managers/thl.py')
| -rw-r--r-- | jb/managers/thl.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/jb/managers/thl.py b/jb/managers/thl.py index 83f49f6..44b6496 100644 --- a/jb/managers/thl.py +++ b/jb/managers/thl.py @@ -23,6 +23,7 @@ import requests def get_user_profile(amt_worker_id: str) -> UserProfile: url = f"{settings.fsb_host}{settings.product_id}/user/{amt_worker_id}/profile/" res = requests.get(url).json() + if res.get("detail") == "user not found": raise ValueError("user not found") @@ -39,6 +40,7 @@ def get_user_blocked_or_not_exists(amt_worker_id: str) -> Optional[bool]: try: res = get_user_profile(amt_worker_id=amt_worker_id) return res.user.blocked if res.user.blocked is not None else False + except ValueError as e: if e.args[0] == "user not found": return True |
