From a9f45b43aa24a6cc4d18021db66a2c2b8009a757 Mon Sep 17 00:00:00 2001 From: SimplifiedPrivacy Date: Mon, 2 Nov 2026 14:53:51 -0500 Subject: [PATCH] Making sure Tor is recognized in location checking --- core/models/orm_models/Location.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/models/orm_models/Location.py b/core/models/orm_models/Location.py index 26d449a..39d8293 100644 --- a/core/models/orm_models/Location.py +++ b/core/models/orm_models/Location.py @@ -58,12 +58,14 @@ class Location(BaseModel): def supports_protocol(self, enum_value: ProtocolChoice|str) -> bool: """Check if a given location supports a given protocol""" + + print(f"enum_value is {enum_value}") if enum_value is None: return False # socks5 proxy name doesn't match 'proxy' - if enum_value == ProtocolChoice.SOCK5_PROXY: + if enum_value in (ProtocolChoice.TOR, "tor", ProtocolChoice.SOCK5_PROXY): return self.is_proxy_capable if isinstance(enum_value, ProtocolChoice): @@ -72,8 +74,11 @@ class Location(BaseModel): string_version = enum_value field_name = f'is_{string_version}_capable' - return bool(getattr(self, field_name)) - + try: + return bool(getattr(self, field_name)) + except Exception as e: + print(str(e)) + return False # to use: # Lookup by location/city codes