Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorygold committed Oct 6, 2023
1 parent e400eee commit 1556eef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion buffalogs/impossible_travel/modules/impossible_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1556eef

Please sign in to comment.