Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

find_account: Fix HTML version of email.

Alex Vandiverdf74c54f3870
diff --git a/templates/zerver/emails/find_team.html b/templates/zerver/emails/find_team.html
index 171b9c17534..bdadb679217 100644
--- a/templates/zerver/emails/find_team.html
+++ b/templates/zerver/emails/find_team.html
@@ -15,8 +15,8 @@
{% endif %}
<ul>
- {% for realm in realms %}
- <li><a href="{{ realm.url }}">{{ realm.name }} ({{ realm.host }})</a></li>
+ {% for realm_data in realms %}
+ <li><a href="{{ realm_data.url }}">{{ realm_data.name }} ({{ realm_data.host }})</a></li>
{% endfor %}
</ul>
diff --git a/templates/zerver/emails/find_team.txt b/templates/zerver/emails/find_team.txt
index 1fcdfd4313d..c24528c67db 100644
--- a/templates/zerver/emails/find_team.txt
+++ b/templates/zerver/emails/find_team.txt
@@ -8,8 +8,8 @@
{% endif %}
-{% for realm in realms %}
-* {{ realm[0] }}: {{ realm[1] }}
+{% for realm_data in realms %}
+* {{ realm_data.name }}: {{ realm_data.url }}
{% endfor %}
{% trans %}If you have trouble logging in, you can reset your password.{% endtrans %}
diff --git a/zerver/views/registration.py b/zerver/views/registration.py
index b22e40801e5..61b72aa75cf 100644
--- a/zerver/views/registration.py
+++ b/zerver/views/registration.py
@@ -1546,7 +1546,13 @@ def find_account(request: HttpRequest) -> HttpResponse:
key = user.delivery_email.lower()
context.setdefault(key, {})
context[key].setdefault("realms", [])
- context[key]["realms"].append([user.realm.name, user.realm.url])
+ context[key]["realms"].append(
+ {
+ "name": user.realm.name,
+ "host": user.realm.host,
+ "url": user.realm.url,
+ }
+ )
# This value will end up being the last user ID among
# matching accounts; since it's only used for minor
# details like language, that arbitrary choice is OK.