From 0258fba345a5bfa1f2ebe2c563b3ff1ffd04e578 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 15 Nov 2022 21:20:53 -0800 Subject: [PATCH] ruff: Fix N811 constant imported as non-constant. Signed-off-by: Anders Kaseorg --- scripts/lib/check-database-compatibility.py | 4 ++-- zerver/data_import/import_util.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/lib/check-database-compatibility.py b/scripts/lib/check-database-compatibility.py index aa02a7de33..8f6946d0b6 100755 --- a/scripts/lib/check-database-compatibility.py +++ b/scripts/lib/check-database-compatibility.py @@ -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) 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 version import ZULIP_VERSION as new_version +from version import ZULIP_VERSION as NEW_VERSION assert_not_running_as_root() setup_path() @@ -84,6 +84,6 @@ logging.error( current_version, len(missing), ZULIP_PATH, - new_version, + NEW_VERSION, ) sys.exit(1) diff --git a/zerver/data_import/import_util.py b/zerver/data_import/import_util.py index 3acf677a2f..b4e969b705 100644 --- a/zerver/data_import/import_util.py +++ b/zerver/data_import/import_util.py @@ -28,7 +28,7 @@ from django.utils.timezone import now as timezone_now from zerver.data_import.sequencer import NEXT_ID 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 ( Attachment, Huddle, @@ -203,7 +203,7 @@ def make_user_messages( 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["user_profile"] = user_id subscription_dict["recipient"] = recipient_id