mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
auth: Add an organization reactivation flow with admin confirmation.
This adds a web flow and management command for reactivating a Zulip organization, with confirmation from one of the organization administrators. Further work is needed to make the emails nicer (ideally, we'd send one email with all the admins on the `To` line, but the `send_email` library doesn't support that). Fixes #10783. With significant tweaks to the email text by tabbott.
This commit is contained in:
committed by
Tim Abbott
parent
10e8e2acac
commit
d00b889402
@@ -5140,3 +5140,15 @@ def missing_any_realm_internal_bots() -> bool:
|
||||
.annotate(Count('id')))
|
||||
realm_count = Realm.objects.count()
|
||||
return any(bot_counts.get(email, 0) < realm_count for email in bot_emails)
|
||||
|
||||
def do_send_realm_reactivation_email(realm: Realm) -> None:
|
||||
confirmation_url = create_confirmation_link(realm, realm.host, Confirmation.REALM_REACTIVATION)
|
||||
admins = realm.get_admin_users()
|
||||
context = {'confirmation_url': confirmation_url,
|
||||
'realm_uri': realm.uri,
|
||||
'realm_name': realm.name}
|
||||
for admin in admins:
|
||||
send_email(
|
||||
'zerver/emails/realm_reactivation', to_email=admin.email,
|
||||
from_address=FromAddress.tokenized_no_reply_address(),
|
||||
from_name="Zulip Account Security", context=context)
|
||||
|
||||
Reference in New Issue
Block a user