mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 12:54:58 +00:00
ruff: Fix SIM113 Use enumerate() for index variable in for loop.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 53e80c41ea)
This commit is contained in:
committed by
Tim Abbott
parent
3f9e4bd54b
commit
230574ebbf
@@ -786,12 +786,7 @@ def import_uploads(
|
||||
bucket_name = settings.S3_AUTH_UPLOADS_BUCKET
|
||||
bucket = get_bucket(bucket_name)
|
||||
|
||||
count = 0
|
||||
for record in records:
|
||||
count += 1
|
||||
if count % 1000 == 0:
|
||||
logging.info("Processed %s/%s uploads", count, len(records))
|
||||
|
||||
for count, record in enumerate(records, 1):
|
||||
if processing_avatars:
|
||||
# For avatars, we need to rehash the user ID with the
|
||||
# new server's avatar salt
|
||||
@@ -878,6 +873,9 @@ def import_uploads(
|
||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||
shutil.copy(orig_file_path, file_path)
|
||||
|
||||
if count % 1000 == 0:
|
||||
logging.info("Processed %s/%s uploads", count, len(records))
|
||||
|
||||
if processing_avatars:
|
||||
# Ensure that we have medium-size avatar images for every
|
||||
# avatar. TODO: This implementation is hacky, both in that it
|
||||
|
||||
Reference in New Issue
Block a user