zulip/zerver/lib
Vector73 dec9fd3908 api: Fix sending fake users when fetching inaccessible users via API.
Previously, in the `GET /users` API suite, `user_list_incomplete=False` was
being incorrectly used when fetching users which resulted in the server
returning fake users for guest users that lack permission to see all users
in the organization. This commit fixes this bug.

Fixes #36559.
2025-11-25 15:48:20 -08:00
..
markdown tabbed_sections: Delete unused entries from TAB_SECTION_LABELS. 2025-11-24 09:27:54 -08:00
upload upload: Use normpath when comparing to LOCAL_UPLOADS_DIR. 2025-10-14 12:56:10 -07:00
url_preview python: Replace deprecated BeautifulSoup.findAll. 2025-02-18 22:04:43 -08:00
webhooks webhooks: Add nocoverage comment for unused MAPPING. 2025-08-07 17:39:05 -07:00
__init__.py
addressee.py scheduled_messages: Set read_by_sender for self-DMs using DM group. 2025-07-21 22:46:38 -07:00
alert_words.py ruff: Fix RUF059 Unpacked variable is never used. 2025-09-30 16:47:54 -07:00
async_utils.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
attachments.py message: Use .is_channel_message column instead of is_stream_message(). 2025-08-19 23:37:07 -07:00
avatar_hash.py avatars: Encode version into the filename. 2024-07-07 14:40:07 -07:00
avatar.py avatar: Add option to disable gravatars per realm. 2025-01-30 18:46:02 -08:00
bot_config.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
bot_lib.py worker: Flag messages processed by outgoing bot. 2025-01-24 17:56:44 -08:00
bot_storage.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
bulk_create.py groups: Use realm_for_sharding for limiting NamedUserGroup queries. 2025-09-23 12:15:53 -07:00
cache_helpers.py cache_helpers: Use iterators, so we do not keep the full list in memory. 2025-10-01 10:36:37 -07:00
cache.py users: Use is_imported_stub flag for imported users. 2025-11-10 14:03:52 -08:00
camo.py typing: Apply trivial none-checks with assertions as necessary. 2022-06-23 19:25:48 -07:00
channel_folders.py channel-folders: Order by order field in GET method. 2025-08-06 16:34:40 -07:00
compatibility.py ruff: Fix PLR6104 Use += to perform an augmented assignment directly. 2024-07-14 13:49:51 -07:00
context_managers.py ruff: Fix SIM117 Use a single with statement with multiple contexts. 2024-07-14 13:48:32 -07:00
create_user.py api: Improve handling of delivery_email in the GET /users/{email} API. 2024-10-08 18:01:49 -07:00
db_connections.py db: Split reset_queries into a new module zerver.lib.db_connections. 2024-04-17 16:49:03 -07:00
db.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
debug.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
default_streams.py default streams: Return set instead of a list. 2025-01-22 10:55:25 -08:00
demo_organizations.py demo-orgs: Delete expired demo orgs in archive_messages cron job. 2025-06-07 22:53:01 -07:00
dev_ldap_directory.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
digest.py CVE-2025-52559: Generate HTML for digest new channels safely. 2025-07-02 12:12:36 -07:00
display_recipient.py get_recipient_ids: Include user ID for self-messages using DM group. 2025-08-28 10:04:37 -07:00
domains.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
drafts.py ruff: Fix RUF059 Unpacked variable is never used. 2025-09-30 16:47:54 -07:00
email_mirror_helpers.py ruff: Fix RUF059 Unpacked variable is never used. 2025-09-30 16:47:54 -07:00
email_mirror_server.py email_mirror_server: Fix the logfile path which is checked. 2025-10-23 11:57:30 -07:00
email_mirror.py email_mirror: For topic-less channels, put subject in body. 2025-11-05 12:19:21 -08:00
email_notifications.py email_notifications: Prepare "header" only for digest emails. 2025-11-25 10:04:44 -08:00
email_validation.py ruff: Fix RUF059 Unpacked variable is never used. 2025-09-30 16:47:54 -07:00
emoji_utils.py emoji: Match emoji sequences in markdown. 2023-08-23 16:18:15 -07:00
emoji.py emoji: Use a non-predictable filename. 2024-07-12 13:26:47 -07:00
event_schema.py users: Use is_imported_stub flag for imported users. 2025-11-10 14:03:52 -08:00
event_types.py users: Use is_imported_stub flag for imported users. 2025-11-10 14:03:52 -08:00
events.py api: Add server_report_message_types to realm. 2025-11-21 12:02:44 -08:00
exceptions.py video_calls: Extract common OAuth methods into a base class. 2025-11-20 15:13:40 -08:00
export.py personal_recipient: Handle cases with none values. 2025-11-25 10:19:32 -08:00
external_accounts.py ruff: Fix UP006 Use list instead of List for type annotation. 2024-07-13 22:28:22 -07:00
fix_unreads.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
generate_test_data.py ruff: Fix PLR6104 Use += to perform an augmented assignment directly. 2024-07-14 13:49:51 -07:00
github.py apps: Provide arm64 app build by default for macOS. 2025-03-28 16:45:07 -07:00
home.py zephyr: Remove Zephyr mirroring support. 2025-09-16 11:18:18 -07:00
html_diff.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
html_to_text.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
i18n.py registration: Fix language code missing for find_team emails. 2025-03-24 14:41:23 -07:00
import_realm.py personal_recipient: Handle cases with none values. 2025-11-25 10:19:32 -08:00
initial_password.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
integrations.py integrations: Improve categorization of certain integrations. 2025-11-21 12:18:57 -08:00
invites.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
logging_util.py logging_util: Error-proof against weird exc_info. 2025-05-19 16:39:44 -07:00
management.py checks: Move checkconfig to standard check framework. 2025-11-19 11:50:18 -08:00
mdiff.py tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
mention.py groups: Use realm_for_sharding for limiting NamedUserGroup queries. 2025-09-23 12:15:53 -07:00
message_cache.py message_cache: Skip pickling JSON-encoded string in cache. 2025-08-27 09:22:56 -07:00
message_report.py message_report: Use reason_type's user-facing string in template. 2025-11-11 15:10:04 -08:00
message.py personal_recipient: Handle cases with none values. 2025-11-25 10:19:32 -08:00
migrate.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
migration_status.py migration_status: Refactor parse_migration_status. 2025-03-20 10:57:54 -07:00
mime_types.py mime_types: Remove incorrect comment, and add audio/mp4 and audio/webm. 2025-07-16 09:20:31 -07:00
mobile_auth_otp.py ruff: Fix B905 zip() without an explicit strict= parameter. 2024-07-13 22:28:22 -07:00
muted_users.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
name_restrictions.py signup: Add "airsi.de" as an allowed email domain. 2025-03-19 10:04:11 -07:00
narrow_helpers.py url_decoding: Add parse_narrow_url. 2025-02-24 15:37:40 -08:00
narrow_predicate.py narrow_term: Refactor a NeverNegatedNarrowTerm. 2025-02-24 15:37:40 -08:00
narrow.py personal_recipient: Handle cases with none values. 2025-11-25 10:19:32 -08:00
navigation_views.py navigation_views: Add backend for navigation views in left sidebar. 2025-05-23 16:25:08 -07:00
notes.py ruff: Fix PYI059 Generic[] should always be the last base class. 2025-09-30 16:47:54 -07:00
notification_data.py notification_data: Fix a typo. 2025-11-03 15:45:22 -08:00
onboarding_steps.py onboarding_steps: Add 'navigation_tour_video' for new users. 2025-03-13 14:38:16 -07:00
onboarding.py semgrep: Enforce use of .iterator() when sensible. 2025-11-18 22:59:52 -08:00
outgoing_http.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
outgoing_webhook.py outgoing_webhook: Lump chunked-encoding errors with connection errors. 2025-09-05 10:35:01 -07:00
parallel.py parallel: Refactor to provide a callback form. 2025-11-05 11:49:55 -08:00
partial.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
per_request_cache.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
presence.py presence: Add helpful in-code comments pointing to API docs. 2025-11-20 12:41:16 -08:00
profile.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
push_notifications.py push_notification: Avoid extra DB call to fetch realm. 2025-11-19 09:38:34 -08:00
push_registration.py push_notification: Use symmetric cryptography to encrypt notifications. 2025-11-07 12:00:39 -08:00
pysa.py
query_helpers.py mypy: Remove use of ValuesQuerySet and QuerySetAny. 2024-08-24 17:30:41 -07:00
queue.py ruff: Fix PYI059 Generic[] should always be the last base class. 2025-09-30 16:47:54 -07:00
rate_limiter.py ruff: Fix RUF059 Unpacked variable is never used. 2025-09-30 16:47:54 -07:00
realm_description.py
realm_icon.py settings: Make DEFAULT_LOGO_URI/DEFAULT_AVATAR_URI use staticfiles. 2023-02-14 17:17:06 -05:00
realm_logo.py ruff: Fix UP006 Use list instead of List for type annotation. 2024-07-13 22:28:22 -07:00
recipient_parsing.py scheduled_messages: Migrate to typed_endpoint. 2024-08-20 10:03:22 -07:00
recipient_users.py personal_recipient: Handle cases with none values. 2025-11-25 10:19:32 -08:00
redis_utils.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
reminders.py reminders: Stop interpolating user-provided values in format string. 2025-08-27 12:07:21 -07:00
remote_server.py push_notification: Send end-to-end encrypted push notifications. 2025-07-22 17:08:55 -07:00
request.py request: Use Django 5.2 HttpRequest.get_preferred_type. 2025-07-17 14:37:11 -07:00
response.py requirements: Upgrade Python requirements. 2025-09-30 16:47:54 -07:00
rest.py rest_api: Add logging for use of the deprecated method parameter. 2025-04-24 13:10:52 -07:00
retention.py semgrep: Enforce use of .iterator() when sensible. 2025-11-18 22:59:52 -08:00
safe_session_cached_db.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
scheduled_messages.py zerver: Add endpoints and events for reminders. 2025-07-02 12:47:00 -07:00
scim_filter.py scim: Add support for Groups. 2025-08-08 17:29:11 -07:00
scim.py groups: Use realm_for_sharding for limiting NamedUserGroup queries. 2025-09-23 12:15:53 -07:00
send_email.py custom_emails: Prevent duplicate emails from send_custom_email command. 2025-11-02 11:17:09 -08:00
server_initialization.py migration: Rename 'populate_db' Client to 'ZulipDataImport'. 2025-05-08 12:18:34 -07:00
sessions.py semgrep: Enforce use of .iterator() when sensible. 2025-11-18 22:59:52 -08:00
singleton_bmemcached.py cache: Use zstd compression level 9 for bmemcached compression. 2025-08-27 09:22:56 -07:00
soft_deactivation.py mypy: Fix no-redef errors from django-stubs. 2025-09-30 16:47:54 -07:00
sounds.py ruff: Fix UP006 Use list instead of List for type annotation. 2024-07-13 22:28:22 -07:00
sqlalchemy_utils.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
storage.py storage: Simplify system bot avatar logic. 2024-10-25 10:59:57 -07:00
stream_color.py codespell: Fix typos caught by codespell. 2025-02-18 22:04:43 -08:00
stream_subscription.py stream: Add subscriber_count field. 2025-05-13 17:36:53 -07:00
stream_topic.py ruff: Fix UP006 Use list instead of List for type annotation. 2024-07-13 22:28:22 -07:00
stream_traffic.py stream_traffic: Make stream_ids optional when fetching info for realm. 2025-11-19 17:13:07 -08:00
streams.py stream_traffic: Make stream_ids optional when fetching info for realm. 2025-11-19 17:13:07 -08:00
string_validation.py message_send: Add support to send message with an empty topic name. 2025-01-07 17:24:00 -08:00
subdomains.py auth: Pass None as default_subdomain to verify the host. 2025-07-28 10:59:38 -07:00
subscription_info.py subscription_info: Fetch recent traffic for all streams. 2025-11-19 17:13:07 -08:00
templates.py help_relative_links: Delete. 2025-09-04 09:37:34 -07:00
test_classes.py tests: Fix how found zulip extra context in test helper. 2025-11-20 16:51:55 -08:00
test_console_output.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
test_data.source.txt
test_fixtures.py requirements: Migrate to uv. 2025-02-24 22:29:24 -08:00
test_helpers.py test_helpers: Use care in load_subdomain_token URL parsing. 2025-10-08 23:33:47 -07:00
test_runner.py ruff: Fix FURB122 Use of f.write in a for loop. 2025-06-25 11:49:02 -07:00
tex.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
thumbnail.py get_user_upload_previews: Rename to a more accurate name. 2025-11-19 10:35:06 -08:00
timeout.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
timestamp.py timestamp: Use localized formatting in format_datetime_to_string. 2025-10-03 10:43:16 -07:00
timezone.py ruff: Fix RUF059 Unpacked variable is never used. 2025-09-30 16:47:54 -07:00
topic_link_util.py url_encoding: Standardize to use encode_hash_component. 2025-07-03 14:40:49 -07:00
topic_sqlalchemy.py topic: Enforce is_channel_message=True on topic queries. 2025-03-18 09:34:11 -07:00
topic.py topics: Server generated permalinks now prefer latest message id. 2025-07-03 11:06:39 -07:00
transfer.py parallel: Factor out multiple callsites that use ProcessPoolExecutor. 2025-11-05 11:49:55 -08:00
typed_endpoint_validators.py zerver: Extract function to parse Enum from string value. 2025-05-13 16:04:43 -07:00
typed_endpoint.py ruff: Fix RUF059 Unpacked variable is never used. 2025-09-30 16:47:54 -07:00
types.py users: Use is_imported_stub flag for imported users. 2025-11-10 14:03:52 -08:00
url_decoding.py url_decoding: Add parse_narrow_url. 2025-02-24 15:37:40 -08:00
url_encoding.py notification: Use existing email format for missed 1:1 DM via DM group. 2025-07-24 16:41:52 -07:00
url_redirects.py integrations: Change URL scheme for categories and /doc/ page. 2025-11-07 13:29:34 -08:00
user_agent.py ruff: Fix UP006 Use list instead of List for type annotation. 2024-07-13 22:28:22 -07:00
user_counts.py ruff: Fix UP006 Use list instead of List for type annotation. 2024-07-13 22:28:22 -07:00
user_groups.py user_groups: Fix union typing. 2025-09-30 16:47:54 -07:00
user_message.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
user_status.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
user_topics.py user_topics: Use a list instead of tuple for muted_topics. 2025-03-17 14:21:37 -07:00
users.py api: Fix sending fake users when fetching inaccessible users via API. 2025-11-25 15:48:20 -08:00
utils.py mattermost_import: Log when processing messages. 2025-05-21 16:08:30 -07:00
validator.py requirements: Upgrade Python requirements. 2025-06-25 11:49:02 -07:00
widget.py python: Simplify with str.removeprefix, str.removesuffix. 2024-09-03 12:30:16 -07:00
zcommand.py python: Simplify with str.removeprefix, str.removesuffix. 2024-09-03 12:30:16 -07:00
zstd_level9.py cache: Use zstd compression level 9 for bmemcached compression. 2025-08-27 09:22:56 -07:00
zulip_update_announcements.py updates: Add update (level=23). 2025-11-18 16:35:08 -08:00