mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	Checking for `validate_email_not_already_in_realm` again (after the form already did so), but only in the case that the form fails to validate, means that we may be spending time pushing totally invalid emails to the DB to check. In the case of emails containing nulls, this can even trigger a 500 error from PostgreSQL. Stop calling `validate_email_not_already_in_realm` in the form validation. The form is currently only used in two places -- in `accounts_home` and in `maybe_send_to_registration`. The latter is only called if the address is known to not currently have an account, so checking in there is unnecessary; and in the former case, we wish different behaviour (the redirect) than just validation failure, which is all the validator can do. Fixes #17015. Co-authored-by: Alex Vandiver <alexmv@zulip.com>