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):