mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
data_import: Add email validation to third-party data converters.
This commit makes the third-party data converters check for invalid user emails. If it finds any, it’ll raise an Exception and show an error message with all the bad emails listed out. Fixes: #31783
This commit is contained in:
@@ -39,6 +39,7 @@ from zerver.data_import.import_util import (
|
||||
process_avatars,
|
||||
process_emojis,
|
||||
process_uploads,
|
||||
validate_user_emails_for_import,
|
||||
)
|
||||
from zerver.data_import.sequencer import NEXT_ID
|
||||
from zerver.data_import.slack_message_conversion import (
|
||||
@@ -358,6 +359,7 @@ def users_to_zerver_userprofile(
|
||||
|
||||
logging.info("%s: %s -> %s", slack_user_id, user["name"], userprofile_dict["email"])
|
||||
|
||||
validate_user_emails_for_import(list(found_emails))
|
||||
process_customprofilefields(zerver_customprofilefield, zerver_customprofilefield_values)
|
||||
logging.info("######### IMPORTING USERS FINISHED #########\n")
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user