diff --git a/templates/zerver/emails/password_reset.source.html b/templates/zerver/emails/password_reset.source.html index 1024137a34..bc20691a7b 100644 --- a/templates/zerver/emails/password_reset.source.html +++ b/templates/zerver/emails/password_reset.source.html @@ -7,19 +7,19 @@ on {{ realm_uri }}, but you do not have an active account in {{ realm_uri }}. - {% if accounts %} - {% if multiple_accounts %} + {% if active_accounts %} + {% if multiple_active_accounts %} However, you do have active accounts in the following organizations. You can try logging in or resetting your password in the organization you want. {% else %} - However, you do have an active account in the {{ accounts[0].realm.uri }} + However, you do have an active account in the {{ active_accounts[0].realm.uri }} organization; you can try logging in or resetting your password there. {% endif %} {% endif %} diff --git a/version.py b/version.py index c08ca8d58f..72df0750a0 100644 --- a/version.py +++ b/version.py @@ -8,4 +8,4 @@ ZULIP_VERSION = "1.8.1+git" # Typically, adding a dependency only requires a minor version bump, and # removing a dependency requires a major version bump. -PROVISION_VERSION = '25.5' +PROVISION_VERSION = '25.6' diff --git a/zerver/forms.py b/zerver/forms.py index 6ace254f8f..fd90528e97 100644 --- a/zerver/forms.py +++ b/zerver/forms.py @@ -249,10 +249,10 @@ class ZulipPasswordResetForm(PasswordResetForm): context=context) else: context['no_account_in_realm'] = True - accounts = UserProfile.objects.filter(email__iexact=email) - if accounts: - context['accounts'] = accounts - context['multiple_accounts'] = accounts.count() != 1 + active_accounts = UserProfile.objects.filter(email__iexact=email, is_active=True) + if active_accounts: + context['active_accounts'] = active_accounts + context['multiple_active_accounts'] = active_accounts.count() != 1 send_email('zerver/emails/password_reset', to_email=email, from_name="Zulip Account Security", from_address=FromAddress.tokenized_no_reply_address(),