From 1556eef56b9df6ffe205f1365b4e06efc6cc37c5 Mon Sep 17 00:00:00 2001 From: lorygold Date: Fri, 6 Oct 2023 12:51:23 +0200 Subject: [PATCH] fix --- buffalogs/impossible_travel/modules/impossible_travel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buffalogs/impossible_travel/modules/impossible_travel.py b/buffalogs/impossible_travel/modules/impossible_travel.py index baf59dd..c936bc6 100644 --- a/buffalogs/impossible_travel/modules/impossible_travel.py +++ b/buffalogs/impossible_travel/modules/impossible_travel.py @@ -33,7 +33,7 @@ def calc_distance(self, db_user, prev_login, last_login_user_fields): if distance_km > settings.CERTEGO_BUFFALOGS_DISTANCE_KM_ACCEPTED: last_timestamp_datetimeObj_aware = timezone.make_aware(datetime.strptime(last_login_user_fields["timestamp"], "%Y-%m-%dT%H:%M:%S.%fZ")) - prev_timestamp_datetimeObj_aware = timezone.make_aware(prev_login.timestamp) + prev_timestamp_datetimeObj_aware = prev_login.timestamp # already aware in the db diff_timestamp = last_timestamp_datetimeObj_aware - prev_timestamp_datetimeObj_aware diff_timestamp_hours = diff_timestamp.total_seconds() / 3600