From 98e923619bd81d78453861284dbf19d72e1fa48e Mon Sep 17 00:00:00 2001 From: Longze Chen Date: Tue, 14 Jan 2025 14:18:30 -0500 Subject: [PATCH] Fix command log --- osf/management/commands/migrate_non_versioned_preprints.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osf/management/commands/migrate_non_versioned_preprints.py b/osf/management/commands/migrate_non_versioned_preprints.py index 33c16f6abaa..c1b31711a0c 100644 --- a/osf/management/commands/migrate_non_versioned_preprints.py +++ b/osf/management/commands/migrate_non_versioned_preprints.py @@ -71,7 +71,8 @@ def handle(self, *args, **options): GuidVersionsThrough.objects.bulk_create(vq_list, batch_size=len(vq_list)) total_migrated += len(vq_list) vq_list = [] + success_message = f'Migration completed successfully! [{total_migrated}] preprints have been migrated.' if dry_run: - self.stdout.write(self.style.WARNING('DRY_RUN: Migration has completed successfully! {total_migrated} preprint(s) has been migrated.')) + self.stdout.write(self.style.WARNING(f'DRY_RUN: {success_message}')) else: - self.stdout.write(self.style.SUCCESS('Migration completed successfully! {total_migrated} preprint(s) have been migrated.')) + self.stdout.write(self.style.SUCCESS(success_message))