zulip/zerver
Mateusz Mandera 3623681d30 message_edit: Don't rely on .recipient_id change not affecting recipient.
The codepath for moving a topic changes the message.recipient_id to the
id of the new recipient, but later, in update_messages_for_topic_edit,
it uses message.recipient when querying for messages with the matching
topic in the *old* stream (because those are the other messages that
need to be moved). This is a bug which happens to work fine, because in
Django 2, if message.recipient gets fetched first and then
message.recipient_id is mutated, message.recipient will not be altered
and thus will retain the outdated, previously fetched value.

In Django 3 changing .recipient_id causes .recipient to be updated to
the new Recipient objects, which is the Recipient of the *new* stream.
That will cause the bug to manifest.

This is a bugfix preparing for the upgrade to Django 3.
2021-01-17 10:39:46 -08:00
..
data_import hipchat_import: Remove tool from codebase. 2020-12-23 08:28:49 -08:00
lib message_edit: Don't rely on .recipient_id change not affecting recipient. 2021-01-17 10:39:46 -08:00
management imports: Add better checking for subdomains. 2021-01-12 17:54:01 -08:00
migrations api: Require can_create_users permission to create users via API. 2020-12-21 13:20:21 -08:00
openapi api: Require can_create_users permission to create users via API. 2020-12-21 13:20:21 -08:00
templatetags python: Replace list literal concatenation with * unpacking. 2020-09-02 11:15:41 -07:00
tests minor: Require keywords for verify_action. 2021-01-17 12:31:04 -05:00
tornado tornado: Reduce logging of event queue load/dump. 2020-12-20 12:14:39 -08:00
views registration: Re-use the redirect_to_email_login_url helper. 2021-01-13 11:28:32 -08:00
webhooks webhooks/github: Fix repeating description for edits and updates. 2021-01-04 14:34:17 -08:00
worker python: Open text files as text to skip decode operations. 2020-10-30 11:36:38 -07:00
__init__.py
apps.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
context_processors.py i18n: Don't include email tags in translation strings. 2020-09-25 15:53:26 -07:00
decorator.py home: Allow logged out user through home. 2020-11-02 17:07:12 -08:00
filters.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
forms.py registration: Move "already in realm" check outside of validation. 2021-01-13 11:28:32 -08:00
logging_handlers.py python: Use universal_newlines to get str from subprocess. 2020-10-30 11:36:38 -07:00
middleware.py django3: Save language preference in a cookie rather than the session. 2021-01-17 10:38:58 -08:00
models.py api: Require can_create_users permission to create users via API. 2020-12-21 13:20:21 -08:00
signals.py timezone: Remove get_timezone wrapper. 2020-10-27 13:42:54 -07:00