ruff: Fix N811 constant imported as non-constant.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-11-15 21:20:53 -08:00 committed by Tim Abbott
parent 2876ae8e48
commit 0258fba345
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__f
sys.path.insert(0, ZULIP_PATH) sys.path.insert(0, ZULIP_PATH)
from scripts.lib.setup_path import setup_path from scripts.lib.setup_path import setup_path
from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_version_from from scripts.lib.zulip_tools import DEPLOYMENTS_DIR, assert_not_running_as_root, parse_version_from
from version import ZULIP_VERSION as new_version from version import ZULIP_VERSION as NEW_VERSION
assert_not_running_as_root() assert_not_running_as_root()
setup_path() setup_path()
@ -84,6 +84,6 @@ logging.error(
current_version, current_version,
len(missing), len(missing),
ZULIP_PATH, ZULIP_PATH,
new_version, NEW_VERSION,
) )
sys.exit(1) sys.exit(1)

View File

@ -28,7 +28,7 @@ from django.utils.timezone import now as timezone_now
from zerver.data_import.sequencer import NEXT_ID from zerver.data_import.sequencer import NEXT_ID
from zerver.lib.avatar_hash import user_avatar_path_from_ids from zerver.lib.avatar_hash import user_avatar_path_from_ids
from zerver.lib.stream_color import STREAM_ASSIGNMENT_COLORS as stream_colors from zerver.lib.stream_color import STREAM_ASSIGNMENT_COLORS as STREAM_COLORS
from zerver.models import ( from zerver.models import (
Attachment, Attachment,
Huddle, Huddle,
@ -203,7 +203,7 @@ def make_user_messages(
def build_subscription(recipient_id: int, user_id: int, subscription_id: int) -> ZerverFieldsT: def build_subscription(recipient_id: int, user_id: int, subscription_id: int) -> ZerverFieldsT:
subscription = Subscription(color=random.choice(stream_colors), id=subscription_id) subscription = Subscription(color=random.choice(STREAM_COLORS), id=subscription_id)
subscription_dict = model_to_dict(subscription, exclude=["user_profile", "recipient_id"]) subscription_dict = model_to_dict(subscription, exclude=["user_profile", "recipient_id"])
subscription_dict["user_profile"] = user_id subscription_dict["user_profile"] = user_id
subscription_dict["recipient"] = recipient_id subscription_dict["recipient"] = recipient_id