zulip/zerver/actions
Sahil Batra d645d5c0ec message_edit: Fix code to set visibility policy on moving messages.
The code for updating visibility policy values on moving messages
had two bugs.

- There was a typo in elif condition where "user_profile" was being
used instead of "user_profile_with_policy".

This commit fixes the typo.

- It was assumed that there would be no UserTopic rows for target
topic if the target topic didn't exist. But there can be such case
where some messages were sent to that topic and the user muted
the topic. But then the messages in that topic was deleted. In
such case there can be UserTopic rows for a stream-topic pair
that does not exist.

This commit fixes the code to handle such case as well and set
the visibility policy of new topic to what was set for the original
topic. This change simplifies the condition to just check whether
new_visibility_policy is equal to target_topic_visibility_policy
and skip if so, and update the visibility policy otherwise.

Due to this change, we now do not try to mute the already muted
topic if the topic is moved to a topic which didn't exist
previously and thus we modify the existing test to not expect
any INFO logs.
2023-05-11 12:13:50 -07:00
..
__init__.py
alert_words.py actions: Split out zerver.actions.alert_words. 2022-04-14 17:14:31 -07:00
bots.py bots: Allow changing bot owner without an acting_user. 2022-08-12 17:08:04 -07:00
create_realm.py create_realm: Remove unused argument from do_create_realm. 2023-05-11 12:13:50 -07:00
create_user.py invites: Do not add user to default streams if streams list is empty. 2023-05-09 16:59:06 -07:00
custom_profile_fields.py markdown: Pass realm down into render_stream_description. 2022-11-01 08:20:47 -07:00
default_streams.py typing: Broaden type annotations for QuerySet compatibility. 2022-07-07 11:27:42 -07:00
hotspots.py actions: Split out zerver.actions.hotspots. 2022-04-14 17:14:31 -07:00
invites.py emails: Add corporate_enabled to context for emails. 2023-05-01 10:32:43 -07:00
message_delete.py ruff: Fix PLC0414 Import alias does not rename original package. 2022-12-04 22:11:24 -08:00
message_edit.py message_edit: Fix code to set visibility policy on moving messages. 2023-05-11 12:13:50 -07:00
message_flags.py Remove statsd support. 2023-04-25 19:58:16 -07:00
message_send.py scheduled_messages: Move database related function to /actions. 2023-04-28 17:25:00 -07:00
muted_users.py muted users: Make file naming consistent. 2023-02-10 15:39:57 -08:00
presence.py presence: Support null values in UserPresence. 2023-04-26 14:26:47 -07:00
reactions.py actions: Split out zerver.actions.reactions. 2022-04-14 17:14:35 -07:00
realm_domains.py black: Reformat with Black 23. 2023-02-02 10:40:13 -08:00
realm_emoji.py requirements: Upgrade Django to 4.1. 2022-10-06 15:59:07 -07:00
realm_export.py realm_export: Add transaction.atomic to export_realm. 2023-01-26 10:49:19 -08:00
realm_icon.py realm_audit_log: Explicitly stringify dict before insertion. 2022-07-26 09:48:33 -07:00
realm_linkifiers.py linkifier: Support URL templates for linkifiers. 2023-04-19 12:20:49 -07:00
realm_logo.py actions: Split out zerver.actions.realm_logo. 2022-04-14 17:14:31 -07:00
realm_playgrounds.py actions: Split out zerver.actions.realm_playgrounds. 2022-04-14 17:14:30 -07:00
realm_settings.py emails: Add corporate_enabled to context for emails. 2023-05-01 10:32:43 -07:00
scheduled_messages.py scheduled_messages: Store the final delivered message ID. 2023-05-09 13:48:28 -07:00
streams.py streams: Refactor code to set group-based stream settings. 2023-02-22 12:17:46 -08:00
submessage.py actions: Split out zerver.actions.submessage. 2022-04-14 17:14:30 -07:00
typing.py black: Reformat with Black 23. 2023-02-02 10:40:13 -08:00
uploads.py scheduled_message: Handle attachments properly. 2023-05-08 09:56:02 -07:00
user_activity.py Remove statsd support. 2023-04-25 19:58:16 -07:00
user_groups.py user_groups: rename create_user_group to create_user_group_in_database. 2023-03-27 09:05:00 -07:00
user_settings.py presence: Rewrite the backend data model. 2023-04-26 14:26:47 -07:00
user_status.py user-status: Stop updating the UserStatus model for `away` updates. 2022-09-23 12:27:54 -07:00
user_topics.py user_topics: Update 'set visibility policy' codepath for bulk db operations. 2023-03-29 09:50:06 -07:00
users.py actions: Implement do_delete_user_preserving_messages function. 2023-03-29 12:51:21 -07:00
video_calls.py