From 95f7c010af49a2c9637c8e1b08e97d336884d88a Mon Sep 17 00:00:00 2001 From: MingxuanGame Date: Tue, 7 Oct 2025 12:18:56 +0000 Subject: [PATCH] fix(trusted-device): no location in response --- app/database/verification.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/database/verification.py b/app/database/verification.py index f7e42b3..2e9da05 100644 --- a/app/database/verification.py +++ b/app/database/verification.py @@ -117,8 +117,8 @@ class TrustedDeviceResp(UTCBaseModel, TrustedDeviceBase): def from_db(cls, device: TrustedDevice, get_geoip_helper: GeoIPHelper) -> "TrustedDeviceResp": device_ = cls.model_validate(device.model_dump()) device_.user_agent_info = extract_user_agent(device_.user_agent) - if device_.ip_address: - loc = get_geoip_helper.lookup(device_.ip_address) + if device.ip_address: + loc = get_geoip_helper.lookup(device.ip_address) device_.location = Location( country=loc.get("country_name", ""), city=loc.get("city_name", ""),