From 03184b0077996ca9a241c3a2929a053a36e43abf Mon Sep 17 00:00:00 2001 From: olivierdalang Date: Tue, 21 Oct 2025 15:25:49 +0200 Subject: [PATCH] fix exit logic in checkdata management command --- computedfields/management/commands/checkdata.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/computedfields/management/commands/checkdata.py b/computedfields/management/commands/checkdata.py index db63c06..709671b 100644 --- a/computedfields/management/commands/checkdata.py +++ b/computedfields/management/commands/checkdata.py @@ -72,7 +72,8 @@ def handle(self, *app_labels, **options): end_time = time() duration = int(end_time - start_time) self.eprint(f'\nTotal check time: {timedelta(seconds=duration)}') - sys.exit(1 if has_desync else 0) + if has_desync: + raise CommandError('Desync data found.', returncode=1) @transaction.atomic def action_check(self, models, progress, size, json_out):