zulip/zerver/views
Mateusz Mandera 23a776c144 maybe_send_to_registration: Don't reuse pre-existing PreregistraionUser.
There was the following bug here:
1. Send an email invite to a user.
2. Have the user sign up via social auth without going through that
   invite, meaning either going via a multiuse invite link or just
   straight-up Sign up if the org permissions allow.

That resulted in the PreregistrationUser that got generated in step (1)
having 2 Confirmations tied to it - because maybe_send_to_registration
grabbed the object and created a new confirmation link for it. That is a
corrupted state, Confirmation is supposed to be unique.

One could try to do fancy things with checking whether a
PreregistrationUser already have a Confirmation link, but to avoid races
between ConfirmationEmailWorker and maybe_send_to_registration, this
would require taking locks and so on - which gets needlessly
complicated. It's simpler to not have them compete for the same object.

The point of the PreregistrationUser re-use in
maybe_send_to_registration is that if an admin invites a user, setting
their initial streams and role, it'd be an annoying experience if the
user ends up signing up not via the invite and those initial streams
streams etc. don't get set up. But to handle this, we can just copy the
relevant values from the pre-existing prereg_user, rather than re-using
the object itself.
2022-11-10 17:46:53 -08:00
..
development integrations: Broaden return type of check_send_webhook_fixture_message. 2022-08-06 16:19:48 -07:00
__init__.py
alert_words.py actions: Split out zerver.actions.alert_words. 2022-04-14 17:14:31 -07:00
attachments.py actions: Split out zerver.actions.uploads. 2022-04-14 17:14:32 -07:00
auth.py maybe_send_to_registration: Don't reuse pre-existing PreregistraionUser. 2022-11-10 17:46:53 -08:00
compatibility.py django: Use HttpRequest.headers. 2022-05-13 20:42:20 -07:00
custom_profile_fields.py custom_profile_fields: Fix query for display_in_profile_summary limit. 2022-10-31 14:10:47 -07:00
digest.py mypy: Fix most AnonymousUser type errors. 2021-07-24 14:55:46 -07:00
documentation.py api-docs: Return 404 for direct `/api-doc-template` call. 2022-11-08 08:10:15 -08:00
drafts.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
email_mirror.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
events_register.py register: Not all clients send a User-Agent header. 2022-11-10 16:21:04 -08:00
home.py portico: Move to corporate folder. 2022-08-22 15:53:43 -07:00
hotspots.py actions: Split out zerver.actions.hotspots. 2022-04-14 17:14:31 -07:00
invite.py settings: Make INVITATION_LINK_VALIDITY_MINUTES optional. 2022-07-26 17:07:48 -07:00
message_edit.py message_edit: Support sending notifications with topic changes. 2022-10-11 11:35:41 -07:00
message_fetch.py message_fetch: Move narrowing query builder to zerver.lib.narrow. 2022-09-27 17:02:10 -07:00
message_flags.py do_mark_all_as_read: Split up the work into batches. 2022-10-27 16:59:54 -07:00
message_send.py email_validation: Restore case-insensitive domain validation. 2022-10-20 08:19:07 -07:00
muting.py muting: Add validation for update operations. 2022-07-25 14:03:08 -07:00
presence.py user-status: Move `do_update_user_status` to separate actions file. 2022-09-23 12:27:54 -07:00
push_notifications.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
reactions.py actions: Split out zerver.actions.reactions. 2022-04-14 17:14:35 -07:00
read_receipts.py read_receipts: Exclude muted users from read receipts. 2022-09-16 16:19:54 -07:00
realm.py lint: Replace pycodestyle and pyflakes with ruff. 2022-11-03 12:10:15 -07:00
realm_domains.py realm_domains: Allow only owners to add, edit or delete domains. 2022-09-16 15:27:52 -07:00
realm_emoji.py realm: Create RealmAuditLog entries when removing custom emoji. 2022-07-31 18:32:28 -07:00
realm_export.py realm_export: Improve estimate of data export size. 2022-09-16 14:54:45 -07:00
realm_icon.py upload: Add assertions before accessing uploaded files. 2022-06-23 22:09:05 -07:00
realm_linkifiers.py realm: Create RealmAuditLog entry when removing realm linkifiers. 2022-07-31 18:32:28 -07:00
realm_logo.py upload: Add assertions before accessing uploaded files. 2022-06-23 22:09:05 -07:00
realm_playgrounds.py actions: Split out zerver.actions.realm_playgrounds. 2022-04-14 17:14:30 -07:00
registration.py realm_creation: Rework error pages. 2022-10-31 17:35:06 -07:00
report.py report: Correct type annotation allowing unauth access. 2022-07-26 18:00:24 -07:00
storage.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
streams.py delete_topic: Use the same timeout pattern as /mark_all_as_read. 2022-11-02 16:50:06 -04:00
submessage.py actions: Split out zerver.actions.submessage. 2022-04-14 17:14:30 -07:00
thumbnail.py docs: Remove some outdated references to thumbnailing.md doc. 2022-07-12 17:44:24 -07:00
tutorial.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
typing.py actions: Split out zerver.actions.typing. 2022-04-14 17:14:30 -07:00
unsubscribe.py confirmation: Tighten logic around the mark_object_used parameter. 2022-07-21 15:18:15 -07:00
upload.py upload: Remove `mimetype` url parameter in `get_file_info`. 2022-08-08 16:06:09 -07:00
user_groups.py user_groups: Rename existing_subgroups variable to existing_direct_subgroup_ids. 2022-05-17 14:51:55 -07:00
user_settings.py user_settings: Add user setting to control the user list style. 2022-09-09 16:30:54 -07:00
users.py python: Mark dict parameters with defaults as read-only. 2022-10-06 13:48:28 -07:00
video_calls.py actions: Split out zerver.actions.video_calls. 2022-04-14 17:14:30 -07:00
zephyr.py zephyr: Check PERSONAL_ZMIRROR_SERVER before updating cache. 2022-08-12 17:08:04 -07:00