mirror of https://github.com/zulip/zulip.git
ecbbc3e365
We were going back to the database to get all the users in the realm, when we had them right there already. I believe this is a legacy of us running on a very old version of Django (back in early days), where `bulk_create` didn't give you back ids in a nice way. In the interim we added the `RealmAuditLog` code, which does take advantage of the existing profiles (and proves we can rely on them). But meanwhile we were still doing a query to get all N users in the realm. With `selected_related`! To be fair, bulk_create_users() is by its very nature a pretty infrequent operation. This change is more motivated by code cleanup. Now we just loop through user_ids for the Recipient/Subscriber foreign key rows. I also removed some fairly convoluted code mapping emails to user_ids and just work in user_id space. |
||
---|---|---|
.. | ||
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 |