Skip to content

Commit bebee94

Browse files
committed
Add timezone to login time in e-mail.
1 parent ebfea57 commit bebee94

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

hypha/apply/users/signals.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ def send_login_notification(sender, request, user, **kwargs):
4545
from_email=settings.DEFAULT_FROM_EMAIL,
4646
context={
4747
"user": user,
48-
"login_time": formats.date_format(
49-
timezone.localtime(timezone=user_tz), "SHORT_DATETIME_FORMAT"
48+
"login_time": "{} ({})".format(
49+
formats.date_format(
50+
timezone.localtime(timezone=user_tz), "SHORT_DATETIME_FORMAT"
51+
),
52+
tz_name or timezone.get_current_timezone_name(),
5053
),
5154
"site": Site.find_for_request(request) if request else None,
5255
"ORG_EMAIL": settings.ORG_EMAIL,

0 commit comments

Comments
 (0)