mirror of https://github.com/zulip/zulip.git
7e55cab429
In the prep commits leading up to this, we split out two new helpers: validate_email_is_valid get_errors_for_new_emails Now when we validate invites we use two separate loops to filter our emails. Note that the two extracted functions map to two of the data structures that used to be handled in a single loop, and now we break them out: errors = validate_email_is_valid skipped = get_errors_for_new_emails The first loop checks that emails are even valid to begin with. The second loop finds out whether emails are already in use. The second loop takes advantage of this helper: get_errors_for_new_emails The second helper can query all potential new emails with a single round trip to the database. This reduces our query count. |
||
---|---|---|
.. | ||
data_import | ||
lib | ||
management | ||
migrations | ||
openapi | ||
templatetags | ||
tests | ||
tornado | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py |