Skip to content

Commit

Permalink
fix: handle last_login date of null (pypi#14756)
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman authored Oct 16, 2023
1 parent 85a5f17 commit 92856ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions warehouse/email/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ def send_password_reset_email(request, user_and_email):
{
"action": "password-reset",
"user.id": str(user.id),
"user.last_login": str(user.last_login),
"user.last_login": str(
user.last_login or datetime.datetime.min.replace(tzinfo=pytz.UTC)
),
"user.password_date": str(
user.password_date
if user.password_date is not None
else datetime.datetime.min.replace(tzinfo=pytz.UTC)
user.password_date or datetime.datetime.min.replace(tzinfo=pytz.UTC)
),
}
)
Expand Down

0 comments on commit 92856ad

Please sign in to comment.