mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	realm-deactivation: Send email to owners as part of deactivation.
Creates a new "realm_deactivated" email that can be sent to realm owners as part of `do_deactivate_realm`, via a boolean flag, `email_owners`. This flag is set to `False` when `do_deactivate_realm` is used for realm exports or changing a realm's subdomain, so that the active organization owners are not emailed in those cases. This flag is optional for the `deactivate_realm` management command, but as there is no active user passed in that case, then the email is sent without referencing who deactivated the realm. It is passed as `True` for the support analytics view, but the email that is generated does not include information about the support admin user who completed the request for organization deactivation. When an active organization owner deactivates the organization, then the flag is `True` and an email is sent to them as well as any other active organization owners, with a slight variation in the email text for those two cases. Adds specific tests for when `email_owners` is passed as `True`. All existing tests for other functionality of `do_deactivate_user` pass the flag as `False`. Adds `localize` from django.util.formats as a jinja env filter so that the dates in these emails are internationlized for the owner's default language setting in the "realm_deactivated" email templates. Fixes #24685.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							2eaf098c5d
						
					
				
				
					commit
					673a01ea0c
				
			@@ -1670,7 +1670,9 @@ class AnalyticsBouncerTest(BouncerTestCase):
 | 
			
		||||
        do_set_realm_authentication_methods(zephyr_realm, new_auth_method_dict, acting_user=user)
 | 
			
		||||
 | 
			
		||||
        # Deactivation is synced.
 | 
			
		||||
        do_deactivate_realm(zephyr_realm, acting_user=None, deactivation_reason="owner_request")
 | 
			
		||||
        do_deactivate_realm(
 | 
			
		||||
            zephyr_realm, acting_user=None, deactivation_reason="owner_request", email_owners=False
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        send_server_data_to_push_bouncer()
 | 
			
		||||
        check_counts(5, 5, 1, 1, 7)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user