emails: Fix notify_new_login emails have unserializable context.

Regression introduced in e0f30d0 (PR #7569).
This commit is contained in:
Rishi Gupta 2017-12-22 13:24:46 -08:00 committed by showell
parent c2847669b1
commit e62d9742aa
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@
<p><b>Login details:</b></p> <p><b>Login details:</b></p>
<blockquote> <blockquote>
<p>Server: <a href="{{ realm_uri }}" target="_blank">{{ realm_uri }}</a></p> <p>Server: <a href="{{ realm_uri }}" target="_blank">{{ realm_uri }}</a></p>
<p>Account: <a href="mailto:{{ user.email }}" target="_blank">{{ user.email }}</a></p> <p>Account: <a href="mailto:{{ user_email }}" target="_blank">{{ user_email }}</a></p>
<p>Time: {{ device_info.login_time }}</p> <p>Time: {{ device_info.login_time }}</p>
<p>Device: {{ device_info.device_browser if device_info.device_browser else 'An unknown browser' }} on {{ device_info.device_os if device_info.device_os else 'an unknown operating system' }}.</p> <p>Device: {{ device_info.device_browser if device_info.device_browser else 'An unknown browser' }} on {{ device_info.device_os if device_info.device_os else 'an unknown operating system' }}.</p>
<p>IP Address: {{ device_info.device_ip }}</p> <p>IP Address: {{ device_info.device_ip }}</p>

View File

@ -4,7 +4,7 @@ This is a notification that a new login to your Zulip account has just occurred.
Login details: Login details:
Server: {{ realm_uri }} Server: {{ realm_uri }}
Account: {{ user.email }} Account: {{ user_email }}
Time: {{ device_info.login_time }} Time: {{ device_info.login_time }}
Device: {{ device_info.device_browser if device_info.device_browser else 'an unknown browser' }} on {{ device_info.device_os if device_info.device_os else 'an unknown operating system' }}. Device: {{ device_info.device_browser if device_info.device_browser else 'an unknown browser' }} on {{ device_info.device_os if device_info.device_os else 'an unknown operating system' }}.
IP Address: {{ device_info.device_ip }} IP Address: {{ device_info.device_ip }}

View File

@ -81,7 +81,7 @@ def email_on_new_login(sender: Any, user: UserProfile, request: Any, **kwargs: A
context = common_context(user) context = common_context(user)
context['device_info'] = device_info context['device_info'] = device_info
context['user'] = user context['user_email'] = user.email
email_dict = { email_dict = {
'template_prefix': 'zerver/emails/notify_new_login', 'template_prefix': 'zerver/emails/notify_new_login',