mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	import: Handle corner case around EMAIL_GATEWAY_BOT emails.
This commit is contained in:
		@@ -718,6 +718,10 @@ def do_import_realm(import_dir: Path, subdomain: str) -> Realm:
 | 
			
		||||
    # Remap the user IDs for notification_bot and friends to their
 | 
			
		||||
    # appropriate IDs on this server
 | 
			
		||||
    for item in data['zerver_userprofile_crossrealm']:
 | 
			
		||||
        if item['email'].startswith("emailgateway@"):
 | 
			
		||||
            # The email gateway bot's email is customized to a
 | 
			
		||||
            # different domain on some servers.
 | 
			
		||||
            item['email'] = settings.EMAIL_GATEWAY_BOT
 | 
			
		||||
        logging.info("Adding to ID map: %s %s" % (item['id'], get_system_bot(item['email']).id))
 | 
			
		||||
        new_user_id = get_system_bot(item['email']).id
 | 
			
		||||
        update_id_map(table='user_profile', old_id=item['id'], new_id=new_user_id)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user