python: Fix mypy no_implicit_reexport errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-07-16 13:11:10 -07:00 committed by Tim Abbott
parent 1a985911ef
commit fb3ddf50d4
86 changed files with 168 additions and 142 deletions

View File

@ -5,7 +5,7 @@ from datetime import datetime, timedelta
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
from django.conf import settings from django.conf import settings
from django.db import connection from django.db import connection, models
from django.db.models import F from django.db.models import F
from psycopg2.sql import SQL, Composable, Identifier, Literal from psycopg2.sql import SQL, Composable, Identifier, Literal
@ -20,15 +20,7 @@ from analytics.models import (
) )
from zerver.lib.logging_util import log_to_file from zerver.lib.logging_util import log_to_file
from zerver.lib.timestamp import ceiling_to_day, ceiling_to_hour, floor_to_hour, verify_UTC from zerver.lib.timestamp import ceiling_to_day, ceiling_to_hour, floor_to_hour, verify_UTC
from zerver.models import ( from zerver.models import Message, Realm, RealmAuditLog, Stream, UserActivityInterval, UserProfile
Message,
Realm,
RealmAuditLog,
Stream,
UserActivityInterval,
UserProfile,
models,
)
## Logging setup ## ## Logging setup ##

View File

@ -5,7 +5,6 @@ import orjson
from django.http import HttpResponse from django.http import HttpResponse
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from analytics.views.support import get_org_type_display_name
from corporate.lib.stripe import add_months, update_sponsorship_status from corporate.lib.stripe import add_months, update_sponsorship_status
from corporate.models import Customer, CustomerPlan, LicenseLedger, get_customer_by_realm from corporate.models import Customer, CustomerPlan, LicenseLedger, get_customer_by_realm
from zerver.lib.actions import ( from zerver.lib.actions import (
@ -21,6 +20,7 @@ from zerver.models import (
Realm, Realm,
UserMessage, UserMessage,
UserProfile, UserProfile,
get_org_type_display_name,
get_realm, get_realm,
) )

View File

@ -9,7 +9,7 @@ from django.db import connection
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from django.template import loader from django.template import loader
from django.urls import reverse from django.urls import reverse
from jinja2 import Markup as mark_safe from jinja2.utils import Markup as mark_safe
eastern_tz = pytz.timezone("US/Eastern") eastern_tz = pytz.timezone("US/Eastern")

View File

@ -10,7 +10,7 @@ from django.http import HttpRequest, HttpResponse
from django.shortcuts import render from django.shortcuts import render
from django.template import loader from django.template import loader
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from jinja2 import Markup as mark_safe from jinja2.utils import Markup as mark_safe
from psycopg2.sql import SQL, Composable, Literal from psycopg2.sql import SQL, Composable, Literal
from analytics.lib.counts import COUNT_STATS from analytics.lib.counts import COUNT_STATS
@ -22,11 +22,11 @@ from analytics.views.activity_common import (
realm_stats_link, realm_stats_link,
remote_installation_stats_link, remote_installation_stats_link,
) )
from analytics.views.support import get_org_type_display_name, get_plan_name from analytics.views.support import get_plan_name
from zerver.decorator import require_server_admin from zerver.decorator import require_server_admin
from zerver.lib.request import has_request_variables from zerver.lib.request import has_request_variables
from zerver.lib.timestamp import timestamp_to_datetime from zerver.lib.timestamp import timestamp_to_datetime
from zerver.models import Realm, UserActivityInterval, UserProfile from zerver.models import Realm, UserActivityInterval, UserProfile, get_org_type_display_name
if settings.BILLING_ENABLED: if settings.BILLING_ENABLED:
from corporate.lib.stripe import ( from corporate.lib.stripe import (

View File

@ -44,8 +44,6 @@ if settings.BILLING_ENABLED:
attach_discount_to_realm, attach_discount_to_realm,
downgrade_at_the_end_of_billing_cycle, downgrade_at_the_end_of_billing_cycle,
downgrade_now_without_creating_additional_invoices, downgrade_now_without_creating_additional_invoices,
get_current_plan_by_realm,
get_customer_by_realm,
get_discount_for_realm, get_discount_for_realm,
get_latest_seat_count, get_latest_seat_count,
make_end_of_cycle_updates_if_needed, make_end_of_cycle_updates_if_needed,
@ -53,6 +51,7 @@ if settings.BILLING_ENABLED:
update_sponsorship_status, update_sponsorship_status,
void_all_open_invoices, void_all_open_invoices,
) )
from corporate.models import get_current_plan_by_realm, get_customer_by_realm
def get_plan_name(plan_type: int) -> str: def get_plan_name(plan_type: int) -> str:

View File

@ -32,7 +32,7 @@ no_implicit_optional = true
warn_redundant_casts = true warn_redundant_casts = true
warn_unused_ignores = true warn_unused_ignores = true
warn_return_any = false warn_return_any = false
no_implicit_reexport = false no_implicit_reexport = true
strict_equality = true strict_equality = true
# Display the codes needed for # type: ignore[code] annotations. # Display the codes needed for # type: ignore[code] annotations.
@ -41,6 +41,10 @@ show_error_codes = true
# Warn of unreachable or redundant code. # Warn of unreachable or redundant code.
warn_unreachable = true warn_unreachable = true
[[tool.mypy.overrides]]
module = ["zproject.configured_settings", "zproject.settings"]
no_implicit_reexport = false
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = [ module = [
"ahocorasick.*", "ahocorasick.*",

View File

@ -33,12 +33,13 @@ from zerver.lib.exceptions import (
OrganizationAdministratorRequired, OrganizationAdministratorRequired,
OrganizationMemberRequired, OrganizationMemberRequired,
OrganizationOwnerRequired, OrganizationOwnerRequired,
RateLimited,
RealmDeactivatedError, RealmDeactivatedError,
UnsupportedWebhookEventType, UnsupportedWebhookEventType,
UserDeactivatedError, UserDeactivatedError,
) )
from zerver.lib.queue import queue_json_publish from zerver.lib.queue import queue_json_publish
from zerver.lib.rate_limiter import RateLimited, RateLimitedIPAddr, RateLimitedUser from zerver.lib.rate_limiter import RateLimitedIPAddr, RateLimitedUser
from zerver.lib.request import REQ, get_request_notes, has_request_variables from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_method_not_allowed, json_success, json_unauthorized from zerver.lib.response import json_method_not_allowed, json_success, json_unauthorized
from zerver.lib.subdomains import get_subdomain, user_matches_subdomain from zerver.lib.subdomains import get_subdomain, user_matches_subdomain

View File

@ -14,15 +14,15 @@ from django.http import HttpRequest
from django.urls import reverse from django.urls import reverse
from django.utils.http import urlsafe_base64_encode from django.utils.http import urlsafe_base64_encode
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from jinja2 import Markup as mark_safe from jinja2.utils import Markup as mark_safe
from two_factor.forms import AuthenticationTokenForm as TwoFactorAuthenticationTokenForm from two_factor.forms import AuthenticationTokenForm as TwoFactorAuthenticationTokenForm
from two_factor.utils import totp_digits from two_factor.utils import totp_digits
from zerver.lib.actions import do_change_password, email_not_system_bot from zerver.lib.actions import do_change_password, email_not_system_bot
from zerver.lib.email_validation import email_allowed_for_realm from zerver.lib.email_validation import email_allowed_for_realm
from zerver.lib.exceptions import JsonableError, RateLimited
from zerver.lib.name_restrictions import is_disposable_domain, is_reserved_subdomain from zerver.lib.name_restrictions import is_disposable_domain, is_reserved_subdomain
from zerver.lib.rate_limiter import RateLimited, RateLimitedObject from zerver.lib.rate_limiter import RateLimitedObject
from zerver.lib.request import JsonableError
from zerver.lib.send_email import FromAddress, send_email from zerver.lib.send_email import FromAddress, send_email
from zerver.lib.subdomains import get_subdomain, is_root_domain_available from zerver.lib.subdomains import get_subdomain, is_root_domain_available
from zerver.lib.users import check_full_name from zerver.lib.users import check_full_name

View File

@ -40,8 +40,8 @@ from psycopg2.extras import execute_values
from psycopg2.sql import SQL from psycopg2.sql import SQL
from typing_extensions import TypedDict from typing_extensions import TypedDict
from analytics.lib.counts import COUNT_STATS, RealmCount, do_increment_logging_stat from analytics.lib.counts import COUNT_STATS, do_increment_logging_stat
from analytics.models import StreamCount from analytics.models import RealmCount, StreamCount
from confirmation import settings as confirmation_settings from confirmation import settings as confirmation_settings
from confirmation.models import ( from confirmation.models import (
Confirmation, Confirmation,
@ -70,6 +70,7 @@ from zerver.lib.cache import (
delete_user_profile_caches, delete_user_profile_caches,
display_recipient_cache_key, display_recipient_cache_key,
flush_user_profile, flush_user_profile,
get_stream_cache_key,
to_dict_cache_key_id, to_dict_cache_key_id,
user_profile_by_api_key_cache_key, user_profile_by_api_key_cache_key,
user_profile_delivery_email_cache_key, user_profile_delivery_email_cache_key,
@ -239,7 +240,6 @@ from zerver.models import (
get_realm_playgrounds, get_realm_playgrounds,
get_stream, get_stream,
get_stream_by_id_in_realm, get_stream_by_id_in_realm,
get_stream_cache_key,
get_system_bot, get_system_bot,
get_user_by_delivery_email, get_user_by_delivery_email,
get_user_by_id_in_realm_including_cross_realm, get_user_by_id_in_realm_including_cross_realm,

View File

@ -2,7 +2,7 @@ from typing import Any, Dict, List
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.lib.request import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.upload import delete_message_image from zerver.lib.upload import delete_message_image
from zerver.models import Attachment, UserProfile from zerver.models import Attachment, UserProfile

View File

@ -16,6 +16,7 @@ from zerver.lib.cache import (
cache_set_many, cache_set_many,
get_remote_cache_requests, get_remote_cache_requests,
get_remote_cache_time, get_remote_cache_time,
get_stream_cache_key,
to_dict_cache_key_id, to_dict_cache_key_id,
user_profile_by_api_key_cache_key, user_profile_by_api_key_cache_key,
user_profile_cache_key, user_profile_cache_key,
@ -30,7 +31,6 @@ from zerver.models import (
Stream, Stream,
UserProfile, UserProfile,
get_client_cache_key, get_client_cache_key,
get_stream_cache_key,
huddle_hash_cache_key, huddle_hash_cache_key,
) )

View File

@ -5,8 +5,7 @@ from typing import Tuple
import orjson import orjson
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.lib.exceptions import OrganizationAdministratorRequired from zerver.lib.exceptions import JsonableError, OrganizationAdministratorRequired
from zerver.lib.request import JsonableError
from zerver.lib.storage import static_path from zerver.lib.storage import static_path
from zerver.lib.upload import upload_backend from zerver.lib.upload import upload_backend
from zerver.models import Reaction, Realm, RealmEmoji, UserProfile from zerver.models import Reaction, Realm, RealmEmoji, UserProfile

View File

@ -23,6 +23,7 @@ from zerver.lib.alert_words import user_alert_words
from zerver.lib.avatar import avatar_url from zerver.lib.avatar import avatar_url
from zerver.lib.bot_config import load_bot_config_template from zerver.lib.bot_config import load_bot_config_template
from zerver.lib.compatibility import is_outdated_server from zerver.lib.compatibility import is_outdated_server
from zerver.lib.exceptions import JsonableError
from zerver.lib.external_accounts import DEFAULT_EXTERNAL_ACCOUNTS from zerver.lib.external_accounts import DEFAULT_EXTERNAL_ACCOUNTS
from zerver.lib.hotspots import get_next_hotspots from zerver.lib.hotspots import get_next_hotspots
from zerver.lib.integrations import EMBEDDED_BOTS, WEBHOOK_INTEGRATIONS from zerver.lib.integrations import EMBEDDED_BOTS, WEBHOOK_INTEGRATIONS
@ -41,7 +42,6 @@ from zerver.lib.presence import get_presence_for_user, get_presences_for_realm
from zerver.lib.push_notifications import push_notifications_enabled from zerver.lib.push_notifications import push_notifications_enabled
from zerver.lib.realm_icon import realm_icon_url from zerver.lib.realm_icon import realm_icon_url
from zerver.lib.realm_logo import get_realm_logo_source, get_realm_logo_url from zerver.lib.realm_logo import get_realm_logo_source, get_realm_logo_url
from zerver.lib.request import JsonableError
from zerver.lib.soft_deactivation import reactivate_user_if_soft_deactivated from zerver.lib.soft_deactivation import reactivate_user_if_soft_deactivated
from zerver.lib.stream_subscription import handle_stream_notifications_compatibility from zerver.lib.stream_subscription import handle_stream_notifications_compatibility
from zerver.lib.topic import TOPIC_NAME from zerver.lib.topic import TOPIC_NAME

View File

@ -4,6 +4,7 @@ import multiprocessing
import os import os
import secrets import secrets
import shutil import shutil
from mimetypes import guess_type
from typing import Any, Dict, Iterable, List, Optional, Tuple from typing import Any, Dict, Iterable, List, Optional, Tuple
import orjson import orjson
@ -31,7 +32,7 @@ from zerver.lib.message import get_last_message_id
from zerver.lib.server_initialization import create_internal_realm, server_initialized from zerver.lib.server_initialization import create_internal_realm, server_initialized
from zerver.lib.streams import render_stream_description from zerver.lib.streams import render_stream_description
from zerver.lib.timestamp import datetime_to_timestamp from zerver.lib.timestamp import datetime_to_timestamp
from zerver.lib.upload import BadImageError, get_bucket, guess_type, sanitize_name from zerver.lib.upload import BadImageError, get_bucket, sanitize_name
from zerver.lib.utils import generate_api_key, process_list_in_batches from zerver.lib.utils import generate_api_key, process_list_in_batches
from zerver.models import ( from zerver.models import (
AlertWord, AlertWord,

View File

@ -14,7 +14,8 @@ from django.utils.translation import gettext as _
from psycopg2.sql import SQL from psycopg2.sql import SQL
from typing_extensions import TypedDict from typing_extensions import TypedDict
from analytics.lib.counts import COUNT_STATS, RealmCount from analytics.lib.counts import COUNT_STATS
from analytics.models import RealmCount
from zerver.lib.avatar import get_avatar_field from zerver.lib.avatar import get_avatar_field
from zerver.lib.cache import ( from zerver.lib.cache import (
cache_with_key, cache_with_key,
@ -22,15 +23,11 @@ from zerver.lib.cache import (
to_dict_cache_key, to_dict_cache_key,
to_dict_cache_key_id, to_dict_cache_key_id,
) )
from zerver.lib.display_recipient import ( from zerver.lib.display_recipient import bulk_fetch_display_recipients
DisplayRecipientT, from zerver.lib.exceptions import JsonableError
UserDisplayRecipient,
bulk_fetch_display_recipients,
)
from zerver.lib.markdown import MessageRenderingResult, markdown_convert, topic_links from zerver.lib.markdown import MessageRenderingResult, markdown_convert, topic_links
from zerver.lib.markdown import version as markdown_version from zerver.lib.markdown import version as markdown_version
from zerver.lib.mention import MentionData from zerver.lib.mention import MentionData
from zerver.lib.request import JsonableError
from zerver.lib.stream_subscription import ( from zerver.lib.stream_subscription import (
get_stream_subscriptions_for_user, get_stream_subscriptions_for_user,
get_subscribed_stream_recipient_ids_for_user, get_subscribed_stream_recipient_ids_for_user,
@ -39,6 +36,7 @@ from zerver.lib.stream_subscription import (
from zerver.lib.timestamp import datetime_to_timestamp from zerver.lib.timestamp import datetime_to_timestamp
from zerver.lib.topic import DB_TOPIC_NAME, MESSAGE__TOPIC, TOPIC_LINKS, TOPIC_NAME from zerver.lib.topic import DB_TOPIC_NAME, MESSAGE__TOPIC, TOPIC_LINKS, TOPIC_NAME
from zerver.lib.topic_mutes import build_topic_mute_checker, topic_is_muted from zerver.lib.topic_mutes import build_topic_mute_checker, topic_is_muted
from zerver.lib.types import DisplayRecipientT, UserDisplayRecipient
from zerver.models import ( from zerver.models import (
MAX_TOPIC_NAME_LENGTH, MAX_TOPIC_NAME_LENGTH,
Message, Message,

View File

@ -4,7 +4,7 @@ from typing import Any, Callable, Collection, Dict, Iterable, List, Mapping, Opt
from django.conf import settings from django.conf import settings
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.lib.request import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.topic import RESOLVED_TOPIC_PREFIX, get_topic_from_message_info from zerver.lib.topic import RESOLVED_TOPIC_PREFIX, get_topic_from_message_info
stop_words_list: Optional[List[str]] = None stop_words_list: Optional[List[str]] = None

View File

@ -10,8 +10,8 @@ from django.utils.translation import gettext as _
from requests import Response from requests import Response
from version import ZULIP_VERSION from version import ZULIP_VERSION
from zerver.decorator import JsonableError
from zerver.lib.actions import check_send_message from zerver.lib.actions import check_send_message
from zerver.lib.exceptions import JsonableError
from zerver.lib.message import MessageDict from zerver.lib.message import MessageDict
from zerver.lib.outgoing_http import OutgoingSession from zerver.lib.outgoing_http import OutgoingSession
from zerver.lib.queue import retry_event from zerver.lib.queue import retry_event

View File

@ -5,9 +5,8 @@ from django.utils.timezone import now as timezone_now
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from typing_extensions import TypedDict from typing_extensions import TypedDict
from zerver.lib.exceptions import StreamAdministratorRequired from zerver.lib.exceptions import JsonableError, StreamAdministratorRequired
from zerver.lib.markdown import markdown_convert from zerver.lib.markdown import markdown_convert
from zerver.lib.request import JsonableError
from zerver.lib.stream_subscription import get_active_subscriptions_for_stream_id from zerver.lib.stream_subscription import get_active_subscriptions_for_stream_id
from zerver.models import ( from zerver.models import (
DefaultStreamGroup, DefaultStreamGroup,

View File

@ -24,7 +24,7 @@ from django.core.signing import BadSignature, TimestampSigner
from django.http import HttpRequest from django.http import HttpRequest
from django.urls import reverse from django.urls import reverse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from jinja2 import Markup as mark_safe from jinja2.utils import Markup as mark_safe
from PIL import ExifTags, Image, ImageOps from PIL import ExifTags, Image, ImageOps
from PIL.GifImagePlugin import GifImageFile from PIL.GifImagePlugin import GifImageFile
from PIL.Image import DecompressionBombError from PIL.Image import DecompressionBombError

View File

@ -18,8 +18,7 @@ from zerver.lib.cache import (
user_profile_by_id_cache_key, user_profile_by_id_cache_key,
user_profile_cache_key_id, user_profile_cache_key_id,
) )
from zerver.lib.exceptions import OrganizationAdministratorRequired from zerver.lib.exceptions import JsonableError, OrganizationAdministratorRequired
from zerver.lib.request import JsonableError
from zerver.lib.timezone import canonicalize_timezone from zerver.lib.timezone import canonicalize_timezone
from zerver.models import ( from zerver.models import (
CustomProfileField, CustomProfileField,

View File

@ -1,8 +1,10 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any
from django.core.management.base import CommandError
from zerver.lib.actions import do_deactivate_user, get_active_bots_owned_by_user from zerver.lib.actions import do_deactivate_user, get_active_bots_owned_by_user
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.lib.sessions import user_sessions from zerver.lib.sessions import user_sessions

View File

@ -1,8 +1,10 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any
from django.core.management.base import CommandError
from zerver.lib.actions import do_delete_user, get_active_bots_owned_by_user from zerver.lib.actions import do_delete_user, get_active_bots_owned_by_user
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand): class Command(ZulipBaseCommand):

View File

@ -2,8 +2,10 @@ import sys
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any
from django.core.management.base import CommandError
from zerver.lib.actions import do_add_linkifier, do_remove_linkifier from zerver.lib.actions import do_add_linkifier, do_remove_linkifier
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import linkifiers_for_realm from zerver.models import linkifiers_for_realm

View File

@ -1,9 +1,10 @@
from typing import Any from typing import Any
from django.core.management.base import CommandError
from django.db import ProgrammingError from django.db import ProgrammingError
from confirmation.models import generate_realm_creation_url from confirmation.models import generate_realm_creation_url
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import Realm from zerver.models import Realm

View File

@ -1,7 +1,9 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any
from zerver.lib.management import CommandError, ZulipBaseCommand from django.core.management.base import CommandError
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.rate_limiter import RateLimitedUser from zerver.lib.rate_limiter import RateLimitedUser
from zerver.models import UserProfile, get_user_profile_by_api_key from zerver.models import UserProfile, get_user_profile_by_api_key

View File

@ -3,10 +3,11 @@ from argparse import ArgumentParser
from typing import Any from typing import Any
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.core.management.base import CommandError
from django.db.utils import IntegrityError from django.db.utils import IntegrityError
from zerver.lib.domains import validate_domain from zerver.lib.domains import validate_domain
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import RealmDomain, get_realm_domains from zerver.models import RealmDomain, get_realm_domains

View File

@ -2,8 +2,9 @@ from argparse import ArgumentParser
from typing import Any from typing import Any
from django.conf import settings from django.conf import settings
from django.core.management.base import CommandError
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.lib.send_email import send_custom_email from zerver.lib.send_email import send_custom_email
from zerver.models import Realm, UserProfile from zerver.models import Realm, UserProfile

View File

@ -2,9 +2,10 @@ from argparse import ArgumentParser
from typing import Any, List from typing import Any, List
from django.contrib.auth.tokens import default_token_generator from django.contrib.auth.tokens import default_token_generator
from django.core.management.base import CommandError
from zerver.forms import generate_password_reset_url from zerver.forms import generate_password_reset_url
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.lib.send_email import FromAddress, send_email from zerver.lib.send_email import FromAddress, send_email
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -1,8 +1,10 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Any from typing import Any
from django.core.management.base import CommandError
from zerver.lib.actions import do_send_realm_reactivation_email from zerver.lib.actions import do_send_realm_reactivation_email
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand): class Command(ZulipBaseCommand):

View File

@ -7,11 +7,11 @@ from typing import Optional
import orjson import orjson
from django.conf import settings from django.conf import settings
from django.core.management.base import CommandParser from django.core.management.base import CommandError, CommandParser
from zerver.lib.email_mirror import mirror_email_message from zerver.lib.email_mirror import mirror_email_message
from zerver.lib.email_mirror_helpers import encode_email_address from zerver.lib.email_mirror_helpers import encode_email_address
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import Realm, get_realm, get_stream from zerver.models import Realm, get_realm, get_stream
# This command loads an email from a specified file and sends it # This command loads an email from a specified file and sends it

View File

@ -3,10 +3,10 @@ from typing import Dict, Optional, Union
import orjson import orjson
from django.conf import settings from django.conf import settings
from django.core.management.base import CommandParser from django.core.management.base import CommandError, CommandParser
from django.test import Client from django.test import Client
from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.lib.webhooks.common import standardize_headers from zerver.lib.webhooks.common import standardize_headers
from zerver.models import get_realm from zerver.models import get_realm

View File

@ -2,7 +2,7 @@ from django.db import migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps from django.db.migrations.state import StateApps
from zerver.lib.actions import render_stream_description from zerver.lib.streams import render_stream_description
def render_all_stream_descriptions(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: def render_all_stream_descriptions(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:

View File

@ -54,11 +54,10 @@ from zerver.lib.email_validation import (
get_realm_email_validator, get_realm_email_validator,
validate_email_is_valid, validate_email_is_valid,
) )
from zerver.lib.exceptions import RateLimited from zerver.lib.exceptions import JsonableError, RateLimited
from zerver.lib.initial_password import initial_password from zerver.lib.initial_password import initial_password
from zerver.lib.mobile_auth_otp import otp_decrypt_api_key from zerver.lib.mobile_auth_otp import otp_decrypt_api_key
from zerver.lib.rate_limiter import add_ratelimit_rule, remove_ratelimit_rule from zerver.lib.rate_limiter import add_ratelimit_rule, remove_ratelimit_rule
from zerver.lib.request import JsonableError
from zerver.lib.storage import static_path from zerver.lib.storage import static_path
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import ( from zerver.lib.test_helpers import (
@ -67,10 +66,10 @@ from zerver.lib.test_helpers import (
load_subdomain_token, load_subdomain_token,
use_s3_backend, use_s3_backend,
) )
from zerver.lib.types import Validator
from zerver.lib.upload import MEDIUM_AVATAR_SIZE, resize_avatar from zerver.lib.upload import MEDIUM_AVATAR_SIZE, resize_avatar
from zerver.lib.users import get_all_api_keys from zerver.lib.users import get_all_api_keys
from zerver.lib.validator import ( from zerver.lib.validator import (
Validator,
check_bool, check_bool,
check_dict_only, check_dict_only,
check_int, check_int,

View File

@ -55,11 +55,11 @@ from zerver.lib.request import (
from zerver.lib.response import json_response, json_success from zerver.lib.response import json_response, json_success
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import DummyHandler, HostRequestMock from zerver.lib.test_helpers import DummyHandler, HostRequestMock
from zerver.lib.types import Validator
from zerver.lib.user_agent import parse_user_agent from zerver.lib.user_agent import parse_user_agent
from zerver.lib.users import get_api_key from zerver.lib.users import get_api_key
from zerver.lib.utils import generate_api_key, has_api_key_format from zerver.lib.utils import generate_api_key, has_api_key_format
from zerver.lib.validator import ( from zerver.lib.validator import (
Validator,
check_bool, check_bool,
check_capped_string, check_capped_string,
check_color, check_color,

View File

@ -18,7 +18,6 @@ from zerver.lib.actions import (
ensure_stream, ensure_stream,
) )
from zerver.lib.email_mirror import ( from zerver.lib.email_mirror import (
ZulipEmailForwardError,
create_missed_message_address, create_missed_message_address,
filter_footer, filter_footer,
get_missed_message_token_from_address, get_missed_message_token_from_address,
@ -31,6 +30,7 @@ from zerver.lib.email_mirror import (
strip_from_subject, strip_from_subject,
) )
from zerver.lib.email_mirror_helpers import ( from zerver.lib.email_mirror_helpers import (
ZulipEmailForwardError,
decode_email_address, decode_email_address,
encode_email_address, encode_email_address,
get_email_gateway_message_string_from_address, get_email_gateway_message_string_from_address,

View File

@ -15,11 +15,11 @@ from zerver.lib.actions import (
do_update_user_presence, do_update_user_presence,
) )
from zerver.lib.event_schema import check_restart_event from zerver.lib.event_schema import check_restart_event
from zerver.lib.events import fetch_initial_state_data, get_raw_user_data from zerver.lib.events import fetch_initial_state_data
from zerver.lib.exceptions import AccessDeniedError from zerver.lib.exceptions import AccessDeniedError
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import HostRequestMock, queries_captured, stub_event_queue_user_events from zerver.lib.test_helpers import HostRequestMock, queries_captured, stub_event_queue_user_events
from zerver.lib.users import get_api_key from zerver.lib.users import get_api_key, get_raw_user_data
from zerver.models import ( from zerver.models import (
Realm, Realm,
UserMessage, UserMessage,

View File

@ -8,6 +8,7 @@ import orjson
import pytz import pytz
from django.conf import settings from django.conf import settings
from django.http import HttpResponse from django.http import HttpResponse
from django.test import override_settings
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from corporate.models import Customer, CustomerPlan from corporate.models import Customer, CustomerPlan
@ -20,7 +21,7 @@ from zerver.lib.home import (
) )
from zerver.lib.soft_deactivation import do_soft_deactivate_users from zerver.lib.soft_deactivation import do_soft_deactivate_users
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import get_user_messages, override_settings, queries_captured from zerver.lib.test_helpers import get_user_messages, queries_captured
from zerver.models import ( from zerver.models import (
DefaultStream, DefaultStream,
Realm, Realm,

View File

@ -9,9 +9,9 @@ from django.utils.html import escape
from pyoembed.providers import get_provider from pyoembed.providers import get_provider
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
from zerver.lib.actions import queue_json_publish
from zerver.lib.cache import NotFoundInCache, cache_set, preview_url_cache_key from zerver.lib.cache import NotFoundInCache, cache_set, preview_url_cache_key
from zerver.lib.camo import get_camo_url from zerver.lib.camo import get_camo_url
from zerver.lib.queue import queue_json_publish
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import mock_queue_publish from zerver.lib.test_helpers import mock_queue_publish
from zerver.lib.url_preview.oembed import get_oembed_data, strip_cdata from zerver.lib.url_preview.oembed import get_oembed_data, strip_cdata

View File

@ -8,12 +8,13 @@ from unittest.mock import MagicMock, call, patch
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.core.management import call_command, find_commands from django.core.management import call_command, find_commands
from django.core.management.base import CommandError
from django.test import override_settings from django.test import override_settings
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from confirmation.models import RealmCreationKey, generate_realm_creation_url from confirmation.models import RealmCreationKey, generate_realm_creation_url
from zerver.lib.actions import do_add_reaction, do_create_user from zerver.lib.actions import do_add_reaction, do_create_user
from zerver.lib.management import CommandError, ZulipBaseCommand, check_config from zerver.lib.management import ZulipBaseCommand, check_config
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import most_recent_message, stdout_suppressed from zerver.lib.test_helpers import most_recent_message, stdout_suppressed
from zerver.models import ( from zerver.models import (

View File

@ -22,7 +22,7 @@ from zerver.lib.alert_words import get_alert_word_automaton
from zerver.lib.camo import get_camo_url from zerver.lib.camo import get_camo_url
from zerver.lib.create_user import create_user from zerver.lib.create_user import create_user
from zerver.lib.emoji import get_emoji_url from zerver.lib.emoji import get_emoji_url
from zerver.lib.exceptions import MarkdownRenderingException from zerver.lib.exceptions import JsonableError, MarkdownRenderingException
from zerver.lib.markdown import ( from zerver.lib.markdown import (
MarkdownListPreprocessor, MarkdownListPreprocessor,
MessageRenderingResult, MessageRenderingResult,
@ -47,7 +47,6 @@ from zerver.lib.mention import (
possible_user_group_mentions, possible_user_group_mentions,
) )
from zerver.lib.message import render_markdown from zerver.lib.message import render_markdown
from zerver.lib.request import JsonableError
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.tex import render_tex from zerver.lib.tex import render_tex
from zerver.lib.user_groups import create_user_group from zerver.lib.user_groups import create_user_group

View File

@ -3,11 +3,10 @@ from unittest import mock
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from zerver.lib.actions import get_client
from zerver.lib.push_notifications import get_apns_badge_count, get_apns_badge_count_future from zerver.lib.push_notifications import get_apns_badge_count, get_apns_badge_count_future
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import mock_queue_publish from zerver.lib.test_helpers import mock_queue_publish
from zerver.models import Subscription, UserPresence from zerver.models import Subscription, UserPresence, get_client
from zerver.tornado.event_queue import maybe_enqueue_notifications from zerver.tornado.event_queue import maybe_enqueue_notifications

View File

@ -20,6 +20,7 @@ from zerver.lib.actions import (
do_update_message, do_update_message,
) )
from zerver.lib.avatar import avatar_url from zerver.lib.avatar import avatar_url
from zerver.lib.exceptions import JsonableError
from zerver.lib.mention import MentionData from zerver.lib.mention import MentionData
from zerver.lib.message import ( from zerver.lib.message import (
MessageDict, MessageDict,
@ -29,7 +30,6 @@ from zerver.lib.message import (
update_first_visible_message_id, update_first_visible_message_id,
) )
from zerver.lib.narrow import build_narrow_filter, is_web_public_compatible from zerver.lib.narrow import build_narrow_filter, is_web_public_compatible
from zerver.lib.request import JsonableError
from zerver.lib.sqlalchemy_utils import get_sqlalchemy_connection from zerver.lib.sqlalchemy_utils import get_sqlalchemy_connection
from zerver.lib.streams import StreamDict, create_streams_if_needed, get_public_streams_queryset from zerver.lib.streams import StreamDict, create_streams_if_needed, get_public_streams_queryset
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase

View File

@ -10,7 +10,6 @@ from django.http import HttpResponse
from django.test import override_settings from django.test import override_settings
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from zerver.decorator import JsonableError
from zerver.lib.actions import ( from zerver.lib.actions import (
build_message_send_dict, build_message_send_dict,
check_message, check_message,
@ -35,6 +34,7 @@ from zerver.lib.actions import (
) )
from zerver.lib.addressee import Addressee from zerver.lib.addressee import Addressee
from zerver.lib.cache import cache_delete, get_stream_cache_key from zerver.lib.cache import cache_delete, get_stream_cache_key
from zerver.lib.exceptions import JsonableError
from zerver.lib.message import MessageDict, get_raw_unread_data, get_recent_private_conversations from zerver.lib.message import MessageDict, get_raw_unread_data, get_recent_private_conversations
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import ( from zerver.lib.test_helpers import (

View File

@ -1,8 +1,8 @@
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from zerver.lib.actions import do_change_stream_invite_only, get_client from zerver.lib.actions import do_change_stream_invite_only
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.models import Message, UserMessage, get_realm, get_stream from zerver.models import Message, UserMessage, get_client, get_realm, get_stream
class TopicHistoryTest(ZulipTestCase): class TopicHistoryTest(ZulipTestCase):

View File

@ -3,13 +3,14 @@ from typing import List
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from zerver.lib.actions import get_active_presence_idle_user_ids, get_client from zerver.lib.actions import get_active_presence_idle_user_ids
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.models import ( from zerver.models import (
Message, Message,
UserPresence, UserPresence,
UserProfile, UserProfile,
bulk_get_huddle_user_ids, bulk_get_huddle_user_ids,
get_client,
get_huddle_user_ids, get_huddle_user_ids,
) )

View File

@ -30,16 +30,15 @@ from zerver.lib.actions import (
do_regenerate_api_key, do_regenerate_api_key,
do_update_message_flags, do_update_message_flags,
) )
from zerver.lib.avatar import absolute_avatar_url
from zerver.lib.exceptions import JsonableError
from zerver.lib.push_notifications import ( from zerver.lib.push_notifications import (
APNsContext, APNsContext,
DeviceToken, DeviceToken,
absolute_avatar_url,
b64_to_hex, b64_to_hex,
datetime_to_timestamp,
get_apns_badge_count, get_apns_badge_count,
get_apns_badge_count_future, get_apns_badge_count_future,
get_apns_context, get_apns_context,
get_display_recipient,
get_message_payload_apns, get_message_payload_apns,
get_message_payload_gcm, get_message_payload_gcm,
get_mobile_push_content, get_mobile_push_content,
@ -52,18 +51,18 @@ from zerver.lib.push_notifications import (
send_android_push_notification_to_user, send_android_push_notification_to_user,
send_apple_push_notification, send_apple_push_notification,
send_notifications_to_bouncer, send_notifications_to_bouncer,
send_to_push_bouncer,
) )
from zerver.lib.remote_server import ( from zerver.lib.remote_server import (
PushNotificationBouncerException, PushNotificationBouncerException,
PushNotificationBouncerRetryLaterError, PushNotificationBouncerRetryLaterError,
build_analytics_data, build_analytics_data,
send_analytics_to_remote_server, send_analytics_to_remote_server,
send_to_push_bouncer,
) )
from zerver.lib.request import JsonableError
from zerver.lib.soft_deactivation import do_soft_deactivate_users from zerver.lib.soft_deactivation import do_soft_deactivate_users
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import mock_queue_publish from zerver.lib.test_helpers import mock_queue_publish
from zerver.lib.timestamp import datetime_to_timestamp
from zerver.lib.user_groups import create_user_group from zerver.lib.user_groups import create_user_group
from zerver.models import ( from zerver.models import (
Message, Message,
@ -75,6 +74,7 @@ from zerver.models import (
Subscription, Subscription,
UserMessage, UserMessage,
get_client, get_client,
get_display_recipient,
get_realm, get_realm,
get_stream, get_stream,
receives_offline_push_notifications, receives_offline_push_notifications,

View File

@ -11,8 +11,8 @@ from zerver.lib.actions import (
) )
from zerver.lib.cache import cache_get, to_dict_cache_key_id from zerver.lib.cache import cache_get, to_dict_cache_key_id
from zerver.lib.emoji import emoji_name_to_emoji_code from zerver.lib.emoji import emoji_name_to_emoji_code
from zerver.lib.exceptions import JsonableError
from zerver.lib.message import extract_message_dict from zerver.lib.message import extract_message_dict
from zerver.lib.request import JsonableError
from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import zulip_reaction_info from zerver.lib.test_helpers import zulip_reaction_info
from zerver.models import Message, Reaction, RealmEmoji, UserMessage, get_realm from zerver.models import Message, Reaction, RealmEmoji, UserMessage, get_realm

View File

@ -20,7 +20,6 @@ from confirmation import settings as confirmation_settings
from confirmation.models import ( from confirmation.models import (
Confirmation, Confirmation,
ConfirmationKeyException, ConfirmationKeyException,
MultiuseInvite,
confirmation_url, confirmation_url,
create_confirmation_link, create_confirmation_link,
generate_key, generate_key,
@ -47,7 +46,6 @@ from zerver.lib.actions import (
do_invite_users, do_invite_users,
do_set_realm_property, do_set_realm_property,
get_default_streams_for_realm, get_default_streams_for_realm,
get_stream,
) )
from zerver.lib.email_notifications import enqueue_welcome_emails, followup_day2_email_delay from zerver.lib.email_notifications import enqueue_welcome_emails, followup_day2_email_delay
from zerver.lib.initial_password import initial_password from zerver.lib.initial_password import initial_password
@ -88,6 +86,7 @@ from zerver.models import (
CustomProfileFieldValue, CustomProfileFieldValue,
DefaultStream, DefaultStream,
Message, Message,
MultiuseInvite,
PreregistrationUser, PreregistrationUser,
Realm, Realm,
RealmAuditLog, RealmAuditLog,
@ -99,6 +98,7 @@ from zerver.models import (
UserProfile, UserProfile,
flush_per_request_caches, flush_per_request_caches,
get_realm, get_realm,
get_stream,
get_system_bot, get_system_bot,
get_user, get_user,
get_user_by_delivery_email, get_user_by_delivery_email,

View File

@ -12,6 +12,7 @@ from django.utils.timezone import now as timezone_now
from requests.models import PreparedRequest from requests.models import PreparedRequest
from zerver.data_import.import_util import ( from zerver.data_import.import_util import (
ZerverFieldsT,
build_defaultstream, build_defaultstream,
build_recipient, build_recipient,
build_subscription, build_subscription,
@ -23,7 +24,6 @@ from zerver.data_import.slack import (
AddedChannelsT, AddedChannelsT,
AddedMPIMsT, AddedMPIMsT,
DMMembersT, DMMembersT,
ZerverFieldsT,
channel_message_to_zerver_message, channel_message_to_zerver_message,
channels_to_zerver_stream, channels_to_zerver_stream,
convert_slack_workspace_messages, convert_slack_workspace_messages,

View File

@ -10,13 +10,10 @@ from django.core.exceptions import ValidationError
from django.http import HttpResponse from django.http import HttpResponse
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from zerver.decorator import JsonableError
from zerver.lib.actions import ( from zerver.lib.actions import (
bulk_add_subscriptions, bulk_add_subscriptions,
bulk_get_subscriber_user_ids, bulk_get_subscriber_user_ids,
bulk_remove_subscriptions, bulk_remove_subscriptions,
can_access_stream_user_ids,
create_stream_if_needed,
do_add_default_stream, do_add_default_stream,
do_add_streams_to_default_stream_group, do_add_streams_to_default_stream_group,
do_change_default_stream_group_description, do_change_default_stream_group_description,
@ -39,11 +36,11 @@ from zerver.lib.actions import (
gather_subscriptions_helper, gather_subscriptions_helper,
get_average_weekly_stream_traffic, get_average_weekly_stream_traffic,
get_default_streams_for_realm, get_default_streams_for_realm,
get_stream,
lookup_default_stream_groups, lookup_default_stream_groups,
round_to_2_significant_digits, round_to_2_significant_digits,
validate_user_access_to_subscribers_helper, validate_user_access_to_subscribers_helper,
) )
from zerver.lib.exceptions import JsonableError
from zerver.lib.message import aggregate_unread_data, get_raw_unread_data from zerver.lib.message import aggregate_unread_data, get_raw_unread_data
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.stream_subscription import ( from zerver.lib.stream_subscription import (
@ -56,6 +53,8 @@ from zerver.lib.streams import (
access_stream_by_id, access_stream_by_id,
access_stream_by_name, access_stream_by_name,
can_access_stream_history, can_access_stream_history,
can_access_stream_user_ids,
create_stream_if_needed,
create_streams_if_needed, create_streams_if_needed,
filter_stream_authorization, filter_stream_authorization,
list_to_streams, list_to_streams,
@ -83,6 +82,7 @@ from zerver.models import (
get_client, get_client,
get_default_stream_groups, get_default_stream_groups,
get_realm, get_realm,
get_stream,
get_user, get_user,
get_user_profile_by_id_in_realm, get_user_profile_by_id_in_realm,
) )

View File

@ -38,11 +38,11 @@ from typing_extensions import TypedDict
from version import API_FEATURE_LEVEL, ZULIP_VERSION from version import API_FEATURE_LEVEL, ZULIP_VERSION
from zerver.decorator import cachify from zerver.decorator import cachify
from zerver.lib.exceptions import JsonableError
from zerver.lib.message import MessageDict from zerver.lib.message import MessageDict
from zerver.lib.narrow import build_narrow_filter from zerver.lib.narrow import build_narrow_filter
from zerver.lib.notification_data import UserMessageNotificationsData from zerver.lib.notification_data import UserMessageNotificationsData
from zerver.lib.queue import queue_json_publish, retry_event from zerver.lib.queue import queue_json_publish, retry_event
from zerver.lib.request import JsonableError
from zerver.lib.utils import statsd from zerver.lib.utils import statsd
from zerver.middleware import async_request_timer_restart from zerver.middleware import async_request_timer_restart
from zerver.tornado.autoreload import add_reload_hook from zerver.tornado.autoreload import add_reload_hook

View File

@ -5,9 +5,9 @@ import orjson
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables, internal_notify_view, process_client from zerver.decorator import internal_notify_view, process_client
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.request import get_request_notes from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.validator import ( from zerver.lib.validator import (
check_bool, check_bool,

View File

@ -27,7 +27,6 @@ from two_factor.views import LoginView as BaseTwoFactorLoginView
from confirmation.models import ( from confirmation.models import (
Confirmation, Confirmation,
ConfirmationKeyException, ConfirmationKeyException,
MultiuseInvite,
create_confirmation_link, create_confirmation_link,
get_object_from_key, get_object_from_key,
) )
@ -44,6 +43,7 @@ from zerver.forms import (
from zerver.lib.exceptions import ( from zerver.lib.exceptions import (
AuthenticationFailedError, AuthenticationFailedError,
InvalidSubdomainError, InvalidSubdomainError,
JsonableError,
PasswordAuthDisabledError, PasswordAuthDisabledError,
PasswordResetRequiredError, PasswordResetRequiredError,
RealmDeactivatedError, RealmDeactivatedError,
@ -53,7 +53,7 @@ from zerver.lib.mobile_auth_otp import otp_encrypt_api_key
from zerver.lib.push_notifications import push_notifications_enabled from zerver.lib.push_notifications import push_notifications_enabled
from zerver.lib.pysa import mark_sanitized from zerver.lib.pysa import mark_sanitized
from zerver.lib.realm_icon import realm_icon_url from zerver.lib.realm_icon import realm_icon_url
from zerver.lib.request import REQ, JsonableError, get_request_notes, has_request_variables from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.sessions import set_expirable_session_var from zerver.lib.sessions import set_expirable_session_var
from zerver.lib.subdomains import get_subdomain, is_subdomain_root_or_alias from zerver.lib.subdomains import get_subdomain, is_subdomain_root_or_alias
@ -64,6 +64,7 @@ from zerver.lib.users import get_api_key
from zerver.lib.utils import has_api_key_format from zerver.lib.utils import has_api_key_format
from zerver.lib.validator import validate_login_email from zerver.lib.validator import validate_login_email
from zerver.models import ( from zerver.models import (
MultiuseInvite,
PreregistrationUser, PreregistrationUser,
Realm, Realm,
UserProfile, UserProfile,

View File

@ -11,10 +11,11 @@ from zerver.decorator import do_login, require_post
from zerver.lib.exceptions import ( from zerver.lib.exceptions import (
AuthenticationFailedError, AuthenticationFailedError,
InvalidSubdomainError, InvalidSubdomainError,
JsonableError,
RealmDeactivatedError, RealmDeactivatedError,
UserDeactivatedError, UserDeactivatedError,
) )
from zerver.lib.request import REQ, JsonableError, has_request_variables from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.subdomains import get_subdomain from zerver.lib.subdomains import get_subdomain
from zerver.lib.users import get_api_key from zerver.lib.users import get_api_key

View File

@ -13,8 +13,8 @@ from zerver.lib.actions import (
do_revoke_multi_use_invite, do_revoke_multi_use_invite,
do_revoke_user_invite, do_revoke_user_invite,
) )
from zerver.lib.exceptions import OrganizationOwnerRequired from zerver.lib.exceptions import JsonableError, OrganizationOwnerRequired
from zerver.lib.request import REQ, JsonableError, has_request_variables from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.streams import access_stream_by_id from zerver.lib.streams import access_stream_by_id
from zerver.lib.validator import check_int, check_list from zerver.lib.validator import check_int, check_list

View File

@ -7,12 +7,11 @@ from django.http import HttpRequest, HttpResponse
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import check_update_message, do_delete_messages from zerver.lib.actions import check_update_message, do_delete_messages
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.html_diff import highlight_html_differences from zerver.lib.html_diff import highlight_html_differences
from zerver.lib.message import access_message from zerver.lib.message import access_message
from zerver.lib.request import get_request_notes from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.timestamp import datetime_to_timestamp from zerver.lib.timestamp import datetime_to_timestamp
from zerver.lib.topic import LEGACY_PREV_TOPIC, REQ_topic from zerver.lib.topic import LEGACY_PREV_TOPIC, REQ_topic

View File

@ -32,13 +32,12 @@ from sqlalchemy.sql import (
from sqlalchemy.types import Boolean, Integer, Text from sqlalchemy.types import Boolean, Integer, Text
from zerver.context_processors import get_valid_realm_from_request from zerver.context_processors import get_valid_realm_from_request
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import recipient_for_user_profiles from zerver.lib.actions import recipient_for_user_profiles
from zerver.lib.addressee import get_user_profiles, get_user_profiles_by_ids from zerver.lib.addressee import get_user_profiles, get_user_profiles_by_ids
from zerver.lib.exceptions import ErrorCode, JsonableError, MissingAuthenticationError from zerver.lib.exceptions import ErrorCode, JsonableError, MissingAuthenticationError
from zerver.lib.message import get_first_visible_message_id, messages_for_ids from zerver.lib.message import get_first_visible_message_id, messages_for_ids
from zerver.lib.narrow import is_web_public_compatible, is_web_public_narrow from zerver.lib.narrow import is_web_public_compatible, is_web_public_narrow
from zerver.lib.request import get_request_notes from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.sqlalchemy_utils import get_sqlalchemy_connection from zerver.lib.sqlalchemy_utils import get_sqlalchemy_connection
from zerver.lib.streams import ( from zerver.lib.streams import (

View File

@ -3,14 +3,13 @@ from typing import List, Optional
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import ( from zerver.lib.actions import (
do_mark_all_as_read, do_mark_all_as_read,
do_mark_stream_messages_as_read, do_mark_stream_messages_as_read,
do_update_message_flags, do_update_message_flags,
) )
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.request import get_request_notes from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.streams import access_stream_by_id from zerver.lib.streams import access_stream_by_id
from zerver.lib.topic import user_message_exists_for_topic from zerver.lib.topic import user_message_exists_for_topic

View File

@ -8,7 +8,6 @@ from django.http import HttpRequest, HttpResponse
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import ( from zerver.lib.actions import (
check_schedule_message, check_schedule_message,
check_send_message, check_send_message,
@ -20,7 +19,7 @@ from zerver.lib.actions import (
) )
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.message import render_markdown from zerver.lib.message import render_markdown
from zerver.lib.request import get_request_notes from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.timestamp import convert_to_UTC from zerver.lib.timestamp import convert_to_UTC
from zerver.lib.topic import REQ_topic from zerver.lib.topic import REQ_topic

View File

@ -8,8 +8,9 @@ from django.utils.translation import gettext as _
from zerver.decorator import human_users_only from zerver.decorator import human_users_only
from zerver.lib.actions import do_update_user_status, update_user_presence from zerver.lib.actions import do_update_user_status, update_user_presence
from zerver.lib.exceptions import JsonableError
from zerver.lib.presence import get_presence_for_user, get_presence_response from zerver.lib.presence import get_presence_for_user, get_presence_response
from zerver.lib.request import REQ, JsonableError, get_request_notes, has_request_variables from zerver.lib.request import REQ, get_request_notes, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.timestamp import datetime_to_timestamp from zerver.lib.timestamp import datetime_to_timestamp
from zerver.lib.validator import check_bool, check_capped_string from zerver.lib.validator import check_bool, check_capped_string

View File

@ -3,12 +3,13 @@ from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import human_users_only from zerver.decorator import human_users_only
from zerver.lib.exceptions import JsonableError
from zerver.lib.push_notifications import ( from zerver.lib.push_notifications import (
add_push_device_token, add_push_device_token,
b64_to_hex, b64_to_hex,
remove_push_device_token, remove_push_device_token,
) )
from zerver.lib.request import REQ, JsonableError, has_request_variables from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.models import PushDeviceToken, UserProfile from zerver.models import PushDeviceToken, UserProfile

View File

@ -4,11 +4,11 @@ from django.db import transaction
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import check_add_reaction, do_remove_reaction from zerver.lib.actions import check_add_reaction, do_remove_reaction
from zerver.lib.emoji import emoji_name_to_emoji_code from zerver.lib.emoji import emoji_name_to_emoji_code
from zerver.lib.exceptions import JsonableError
from zerver.lib.message import access_message from zerver.lib.message import access_message
from zerver.lib.request import JsonableError from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.models import Reaction, UserProfile from zerver.models import Reaction, UserProfile

View File

@ -18,9 +18,9 @@ from zerver.lib.actions import (
do_set_realm_property, do_set_realm_property,
do_set_realm_signup_notifications_stream, do_set_realm_signup_notifications_stream,
) )
from zerver.lib.exceptions import OrganizationOwnerRequired from zerver.lib.exceptions import JsonableError, OrganizationOwnerRequired
from zerver.lib.i18n import get_available_language_codes from zerver.lib.i18n import get_available_language_codes
from zerver.lib.request import REQ, JsonableError, has_request_variables from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.retention import parse_message_retention_days from zerver.lib.retention import parse_message_retention_days
from zerver.lib.streams import access_stream_by_id from zerver.lib.streams import access_stream_by_id

View File

@ -10,7 +10,8 @@ from zerver.lib.emoji import (
check_valid_emoji_name, check_valid_emoji_name,
name_to_codepoint, name_to_codepoint,
) )
from zerver.lib.request import REQ, JsonableError, has_request_variables from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.models import RealmEmoji, UserProfile from zerver.models import RealmEmoji, UserProfile

View File

@ -6,8 +6,8 @@ from django.utils.translation import gettext as _
from zerver.decorator import require_realm_admin from zerver.decorator import require_realm_admin
from zerver.lib.actions import do_add_realm_playground, do_remove_realm_playground from zerver.lib.actions import do_add_realm_playground, do_remove_realm_playground
from zerver.lib.exceptions import ValidationFailureError from zerver.lib.exceptions import JsonableError, ValidationFailureError
from zerver.lib.request import REQ, JsonableError, has_request_variables from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.validator import check_capped_string, check_url from zerver.lib.validator import check_capped_string, check_url
from zerver.models import Realm, RealmPlayground, UserProfile from zerver.models import Realm, RealmPlayground, UserProfile

View File

@ -2,7 +2,6 @@ from typing import Dict, List, Optional
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables
from zerver.lib.bot_storage import ( from zerver.lib.bot_storage import (
StateError, StateError,
get_bot_storage, get_bot_storage,
@ -11,6 +10,7 @@ from zerver.lib.bot_storage import (
set_bot_storage, set_bot_storage,
) )
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.validator import check_dict, check_list, check_string from zerver.lib.validator import check_dict, check_list, check_string
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -4,10 +4,10 @@ from django.db import transaction
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import do_add_submessage, verify_submessage_sender from zerver.lib.actions import do_add_submessage, verify_submessage_sender
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.message import access_message from zerver.lib.message import access_message
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.validator import check_int, validate_poll_data, validate_todo_data from zerver.lib.validator import check_int, validate_poll_data, validate_todo_data
from zerver.lib.widget import get_widget_type from zerver.lib.widget import get_widget_type

View File

@ -3,9 +3,9 @@ from typing import List, Optional
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import check_send_typing_notification, do_send_stream_typing_notification from zerver.lib.actions import check_send_typing_notification, do_send_stream_typing_notification
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.streams import access_stream_by_id, access_stream_for_send_message from zerver.lib.streams import access_stream_by_id, access_stream_for_send_message
from zerver.lib.validator import check_int, check_list, check_string_in from zerver.lib.validator import check_int, check_list, check_string_in

View File

@ -17,7 +17,7 @@ from confirmation.models import (
get_object_from_key, get_object_from_key,
render_confirmation_key_error, render_confirmation_key_error,
) )
from zerver.decorator import REQ, has_request_variables, human_users_only from zerver.decorator import human_users_only
from zerver.lib.actions import ( from zerver.lib.actions import (
check_change_full_name, check_change_full_name,
do_change_avatar_fields, do_change_avatar_fields,
@ -29,16 +29,16 @@ from zerver.lib.actions import (
do_set_user_display_setting, do_set_user_display_setting,
do_start_email_change_process, do_start_email_change_process,
get_available_notification_sounds, get_available_notification_sounds,
validate_email_is_valid,
) )
from zerver.lib.avatar import avatar_url from zerver.lib.avatar import avatar_url
from zerver.lib.email_validation import ( from zerver.lib.email_validation import (
get_realm_email_validator, get_realm_email_validator,
validate_email_is_valid,
validate_email_not_already_in_realm, validate_email_not_already_in_realm,
) )
from zerver.lib.exceptions import JsonableError, RateLimited
from zerver.lib.i18n import get_available_language_codes from zerver.lib.i18n import get_available_language_codes
from zerver.lib.rate_limiter import RateLimited from zerver.lib.request import REQ, has_request_variables
from zerver.lib.request import JsonableError
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.send_email import FromAddress, send_email from zerver.lib.send_email import FromAddress, send_email
from zerver.lib.upload import upload_avatar_image from zerver.lib.upload import upload_avatar_image

View File

@ -29,9 +29,13 @@ from zerver.lib.actions import (
from zerver.lib.avatar import avatar_url, get_gravatar_url from zerver.lib.avatar import avatar_url, get_gravatar_url
from zerver.lib.bot_config import set_bot_config from zerver.lib.bot_config import set_bot_config
from zerver.lib.email_validation import email_allowed_for_realm from zerver.lib.email_validation import email_allowed_for_realm
from zerver.lib.exceptions import CannotDeactivateLastUserError, OrganizationOwnerRequired from zerver.lib.exceptions import (
CannotDeactivateLastUserError,
JsonableError,
OrganizationOwnerRequired,
)
from zerver.lib.integrations import EMBEDDED_BOTS from zerver.lib.integrations import EMBEDDED_BOTS
from zerver.lib.request import REQ, JsonableError, has_request_variables from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.streams import access_stream_by_id, access_stream_by_name, subscribed_to_stream from zerver.lib.streams import access_stream_by_id, access_stream_by_name, subscribed_to_stream
from zerver.lib.types import Validator from zerver.lib.types import Validator

View File

@ -21,10 +21,11 @@ from django.views.decorators.http import require_POST
from oauthlib.oauth2 import OAuth2Error from oauthlib.oauth2 import OAuth2Error
from requests_oauthlib import OAuth2Session from requests_oauthlib import OAuth2Session
from zerver.decorator import REQ, has_request_variables, zulip_login_required from zerver.decorator import zulip_login_required
from zerver.lib.actions import do_set_zoom_token from zerver.lib.actions import do_set_zoom_token
from zerver.lib.exceptions import ErrorCode, JsonableError from zerver.lib.exceptions import ErrorCode, JsonableError
from zerver.lib.pysa import mark_sanitized from zerver.lib.pysa import mark_sanitized
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.subdomains import get_subdomain from zerver.lib.subdomains import get_subdomain
from zerver.lib.url_encoding import add_query_arg_to_redirect_url, add_query_to_redirect_url from zerver.lib.url_encoding import add_query_arg_to_redirect_url, add_query_to_redirect_url

View File

@ -3,7 +3,8 @@ from typing import Any, Dict, List
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -2,7 +2,8 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -2,8 +2,8 @@ from typing import Optional
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.request import REQ, RequestVariableMissingError from zerver.lib.request import REQ, RequestVariableMissingError, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -3,7 +3,8 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -2,7 +2,8 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -4,9 +4,10 @@ import dateutil.parser
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.actions import send_rate_limited_pm_notification_to_bot_owner from zerver.lib.actions import send_rate_limited_pm_notification_to_bot_owner
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.send_email import FromAddress from zerver.lib.send_email import FromAddress
from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message

View File

@ -3,7 +3,8 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -3,7 +3,8 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -2,8 +2,9 @@ from typing import Any, Dict, List
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -2,8 +2,9 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -2,8 +2,9 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -3,8 +3,9 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile from zerver.models import UserProfile

View File

@ -3,9 +3,10 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.actions import send_rate_limited_pm_notification_to_bot_owner from zerver.lib.actions import send_rate_limited_pm_notification_to_bot_owner
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.send_email import FromAddress from zerver.lib.send_email import FromAddress
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message

View File

@ -3,9 +3,10 @@ from typing import Any, Dict
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from zerver.decorator import REQ, has_request_variables, webhook_view from zerver.decorator import webhook_view
from zerver.lib.actions import send_rate_limited_pm_notification_to_bot_owner from zerver.lib.actions import send_rate_limited_pm_notification_to_bot_owner
from zerver.lib.exceptions import JsonableError from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success from zerver.lib.response import json_success
from zerver.lib.send_email import FromAddress from zerver.lib.send_email import FromAddress
from zerver.lib.webhooks.common import check_send_webhook_message from zerver.lib.webhooks.common import check_send_webhook_message

View File

@ -67,10 +67,11 @@ from zerver.lib.avatar import avatar_url, is_avatar_new
from zerver.lib.avatar_hash import user_avatar_content_hash from zerver.lib.avatar_hash import user_avatar_content_hash
from zerver.lib.dev_ldap_directory import init_fakeldap from zerver.lib.dev_ldap_directory import init_fakeldap
from zerver.lib.email_validation import email_allowed_for_realm, validate_email_not_already_in_realm from zerver.lib.email_validation import email_allowed_for_realm, validate_email_not_already_in_realm
from zerver.lib.exceptions import JsonableError
from zerver.lib.mobile_auth_otp import is_valid_otp from zerver.lib.mobile_auth_otp import is_valid_otp
from zerver.lib.rate_limiter import RateLimitedObject from zerver.lib.rate_limiter import RateLimitedObject
from zerver.lib.redis_utils import get_dict_from_redis, get_redis_client, put_dict_in_redis from zerver.lib.redis_utils import get_dict_from_redis, get_redis_client, put_dict_in_redis
from zerver.lib.request import JsonableError, get_request_notes from zerver.lib.request import get_request_notes
from zerver.lib.subdomains import get_subdomain from zerver.lib.subdomains import get_subdomain
from zerver.lib.users import check_full_name, validate_user_custom_profile_field from zerver.lib.users import check_full_name, validate_user_custom_profile_field
from zerver.models import ( from zerver.models import (