Commit Graph

4102 Commits

Author SHA1 Message Date
Shubham Padia
7eb9c9deef Groups: Can perform any join, leave, add, remove for deactivated group.
Fixes #33804.

We still do not allow permission settings to be set to deactivated
groups.
2025-06-11 14:58:14 -07:00
Sahil Batra
d8ae21a4f4 folders: Don't allow archiving a folder if it contains channels. 2025-05-29 15:39:03 -07:00
Sahil Batra
88b47be938 channel_folders: Pass realm as argument to check_add_channel_folder.
Passing realm explicitly to check_add_channel_folder instead of
using realm field from acting_user seems much cleaner and readable.
2025-05-29 15:39:03 -07:00
Sahil Batra
ad9abb8e2d streams: Use "isinstance" instead of "is" for "Missing" check. 2025-05-29 15:39:03 -07:00
Lauryn Menard
fd16c2e2b0 templates: Update deactivated organization template for deleted data.
If a realm's data has been scrubbed, update the deactivated realm
to note the URL can be reused, but not that the realm can be
reactivated.

Updates the template for context variables that are no longer used.
2025-05-28 17:32:29 -07:00
Aman Agrawal
e07a17eff5 slack_import: Add instruction to get export file. 2025-05-28 17:18:07 -07:00
Aman Agrawal
18b0681d26 slack_import: Show validation error on empty slack access token.
We used to rely on browser to show error for empty slack access
token, but now we are using our own error element for this.
2025-05-28 17:18:07 -07:00
Aditya Kumar Kasaudhan
c5f126c6ff navigation_views: Add backend for navigation views in left sidebar.
Fixes part of #32077.
2025-05-23 16:25:08 -07:00
Alex Vandiver
df74c54f38 find_account: Fix HTML version of email.
This was broken in the refactor in 0078310be7.
2025-05-22 10:31:21 -07:00
Lauryn Menard
8830373c9e demo-orgs: Disable allowing users to join until owner email set.
Until a demo organization creator sets an email address, we want to
restrict other users from joining the organization. Therefore, we
disable changing the "invite_required" setting for the organization
until they set their email address. Otherwise, the owner could
share the demo organization URL with someone and they could create
an account via the homepage.

Checks the demo organization owner delivery email address state
on the server-side.

Disables updating the organization setting in the web app UI.
2025-05-21 15:52:38 -07:00
Lauryn Menard
c9592c62f8 demo-orgs: Check owner email state when changing subdomain.
Enforce checking the demo organization owner delivery email on
the server-side when converting the organization to a permanent
organization via changing the subdomain.
2025-05-21 15:52:38 -07:00
Lauryn Menard
28b1a071fe demo-orgs: Schedule onboarding/welcome emails when owner adds email.
When a demo organization creator confirms their email change for
their account, we now schedule the series of onboarding emails
via enqueue_welcome_emails.

If a demo organization is deactivated/deleted before the emails
are sent, any scheduled emails are deleted as part of that process.

We use the current datetime for getting the onboarding schedule
for the onboarding emails in this case, instead of the datetime the
user joined/created the organization.
2025-05-20 16:25:51 -07:00
Sahil Batra
2f34e6d24c streams: Add API support to update folder of a stream.
Fixes part of #31972.
2025-05-20 13:25:06 -07:00
Sahil Batra
ec96fc9659 streams: Allow adding newly created channels to folders.
Fixes part of #31972.
2025-05-20 13:25:06 -07:00
Sahil Batra
5de0f265bd channel_folders: Add support to update channel folders.
Fixes part of #31972.
2025-05-20 13:25:06 -07:00
Sahil Batra
e93667cc06 channel_folders: Add API endpoint to get all channel folders.
Fixes part of #31972.
2025-05-20 13:25:06 -07:00
Sahil Batra
332abd9e91 channel_folder: Add API to create a channel folder.
This commit also includes code to include channel_folders
data in register response.

Fixes part of #31972.
2025-05-20 13:25:06 -07:00
Alex Vandiver
c6e0f0b436 email-mirror: Remove HTTP interface. 2025-05-19 16:39:44 -07:00
whilstsomebody
2780360b00 unarchive: Add support for unarchiving archived channels.
This commit adds support for unarchiving archived channels
by introducing the `is_archived` parameter to the
`PATCH /streams/{stream_id}` API endpoint. Sending a PATCH
request with `is_archived: false` will unarchive the specified
channel.
2025-05-16 11:39:40 -07:00
Alex Vandiver
0078310be7 find_account: Do not place Realm objects into context. 2025-05-16 11:30:48 -07:00
Sahil Batra
d2ff4bda4c streams: Check creation permission when updating channel privacy.
User who did not have permission to create public channels
could create them by first creating a private or web-public
channel, if they had the permission to create them, and then
changing privacy of that stream to be a public stream.

Similarly user without permission to create private channels
could also create them.

This commit fixes both these bugs.
2025-05-15 15:37:41 -07:00
Aman Agrawal
1dc845f07b users: Allow spectators to access /users API endpoint.
We need this to support faster initial loading time for spectators.
2025-05-15 12:37:29 -07:00
Sahil Batra
54b51823e6 user_groups: Add API support to reactivate a user group.
This commit adds support to reactivate a user group using
`PATCH /user_groups/{user_group_id}` endpoint.

Fixes part of #23568.
2025-05-14 13:24:54 -07:00
Aman Agrawal
136c0f1c44 registration: Enable import from slack using realm registration form.
Co-authored-by: Alex Vandiver <alexmv@zulip.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-05-14 13:24:38 -07:00
Saubhagya Patel
70e45f45c0 settings: Add setting for marking resolved-topic notices as read.
This commit adds a new personal setting
`resolved_topic_notice_auto_read_policy` which controls how
resolved-topic notices are marked as read for a user.

Fixes #33599.
2025-05-13 16:23:21 -07:00
Saubhagya Patel
934042d47e zerver: Extract function to parse Enum from string value.
This commit extracts a function from `zerver/views/realm.py` used
for `message_edit_history_visibility_policy` so it can be reused
for other settings.
2025-05-13 16:04:43 -07:00
Kislay Verma
316d1cf285 topic_link_util: Use module to generate correct links.
In this commit, we use the said module instead of using
the `#**..**` syntax for channel and topic links.

Fixes #34608
2025-05-13 15:56:57 -07:00
Tim Abbott
97ffd0fd5d users: Use mandatory kwargs in get_user_data. 2025-05-12 15:49:43 -07:00
Aman Agrawal
45d2c8acf5 users: Add parameter to fetch user data for a list of user ids.
This will help us defer loading user data from initial app load
to later when the user data is required.
2025-05-12 15:49:43 -07:00
Aman Agrawal
b459f6f3d2 users: Separate view function to get singer user data.
This will avoid overloading a function with similar parameters when
we add `user_ids` parameter to `get_members_backend`.
2025-05-12 15:13:49 -07:00
PieterCK
0814fb88c1 api: Add a new endpoint for message reporting.
This adds a new API endpoint that enables users to report messages for
review by admins or moderators. Reports will be sent to the
`moderate_request_channel`, so it must be configured for this feature to
be enabled.

Fixes part of #20047.

Co-authored-by: Adam Sah <140002+asah@users.noreply.github.com>
2025-05-06 15:59:55 -07:00
PieterCK
cc39b6860b email_change: Use HTML error for user deactivated error.
Currently when a deactivated user tries to access the change email link
(generated when their account still active), a JSON error message will
be shown.

This adds a new portico error page for user deactivated errors. Now,
`confirm_email_change` renders a portico error page when the user trying
to change their email is deactivated.

Fixes #20227.
2025-05-06 11:12:16 -07:00
Anders Kaseorg
acd7353538 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-05 09:10:19 -07:00
Aman Agrawal
733817cb51 reminders: Add API endpoint to schedule reminders. 2025-05-02 16:48:00 -07:00
Aman Agrawal
ad9cb50183 scheduled_messages: Extract exception for invalid delivery time. 2025-05-02 16:48:00 -07:00
Aman Agrawal
3cf4251944 registration: Only add realm creation context if form is for that. 2025-04-30 00:06:43 -07:00
Aman Agrawal
5d4142e056 realm_creation_form: Capture import_from if realm import enabled.
We store user's preference for `import_from` to be acted upon in
later commits.
2025-04-30 00:06:43 -07:00
Aman Agrawal
b68479f623 tusd: Support None value for MAX_WEB_DATA_IMPORT_SIZE_MB.
Adds support for `None` and defines how different values will be
used in `prod_settings_template.py`.
2025-04-30 00:06:43 -07:00
Aman Agrawal
5a5660fcbf tusd: Use upload failure message similar to one in compose upload. 2025-04-30 00:06:43 -07:00
Alex Vandiver
eae18738a6 signup: Add optional Altcha to realm registration. 2025-04-23 17:18:40 -07:00
Shubham Padia
b8ba174455 users: Return true for admins for is_moderator.
This change is for consistency with how is_admin works.

API design discussion at https://chat.zulip.org/#narrow/channel/378-api-design/topic/Should.20is_moderator.20have.20admins
2025-04-22 11:24:49 -07:00
Kislay Verma
e2e0603689 message_edit: Check previous message content to prevent races.
Similar to group based setting values, we expect
the client to send the previous content alongwith
the edited content to the edit message endpoint.
We reject the request incase the previous content
doesn't match the current message content, which
could happen in case two users simultaneously edit
a message - which will be implemented in #33051.
2025-04-16 14:05:12 -07:00
Mateusz Mandera
57d77e0a55 realm_creation: Disable open realm creation if no password backend. 2025-04-15 18:28:16 -07:00
Mateusz Mandera
c4bb6509dd signup: Prevent unauthorized signup for realms without EmailAuthBackend.
Zulip supports a configuration where account creation is limited solely
by being able to authenticate with a single-sign on authentication
backend, such as Google Authentication, SAML, or LDAP (i.e., the
organization places no restrictions on email address domains or
invitations being required to join, but has disabled the
EmailAuthBackend that is used for email/password authentication).

A bug in the Zulip server meant that Zulip allowed users to create an
account in such organizations by confirming their email address, without
having an account with the SSO authentication backend.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-04-15 18:28:16 -07:00
Ritwik
2429157498 streams: Don't glue translated strings in new channel notification.
We now translate the whole notification message instead of substituting
an already translated policy_name. This avoids scenarios where only part
of the notification message is translated.

Fixes #30212.

Co-authored-by: Tanmay Kumar <tnmdotkr@gmail.com>
2025-04-15 16:28:38 -07:00
Ritwik
187a008f13 streams: Modify get_stream_permission_policy_name to return dict key.
This is a prep commit for #30212. It will allow us to compare the key
and not translated policy name.

Co-authored-by: Tanmay Kumar <tnmdotkr@gmail.com>
2025-04-15 16:28:38 -07:00
Kislay Verma
54be18d430 streams: Change text in notification bot DM.
This commit addresses the second bullet in
zulip#31206 (comment).
2025-04-15 10:35:59 -07:00
Alex Vandiver
cf51013bb7 tusd: Reject tusd terminations after we insert them into our database.
The tusd protocol allows DELETE requests ("terminations") at any
point, including after a file has successfully been uploaded.  This
can allow tusd to remove a file from the bucket, out from under Zulip.

We use the new-in-2.7.0 pre-terminate hook to look up the file which
the client is requesting to terminate, and reject the termination if
it is a file that the Zulip database is already aware of.
2025-04-11 12:13:07 -07:00
Sahil Batra
179782eaba user_groups: Refactor is_user_in_group and is_any_user_in_group.
This commit updates is_user_in_group and is_any_user_in_group
to accept group ID as parameter instead of UserGroup object.

This is a prep commit for updating code to not prefetch
direct message permissions group.
2025-04-07 15:34:30 -07:00
Aman Agrawal
80c9698943 registration: Fix 500 error pages rendered without context.
We need `corporate_enabled` and some other params to render
500 error page which is not passed when using `server_error`,
as it only contains our custom inserted `DEFAULT_PAGE_PARAMS`.

We render the page with `zulip_default_context` to fix this.
2025-04-04 11:00:06 -07:00