Skip to content

Commit

Permalink
Merge pull request #57 from GitRon/bugfix/scrub-validator-wrong-retur…
Browse files Browse the repository at this point in the history
…n-on-whitelisted-field

Whitelisted model causes wrong return code of "scrub_validaton" command
  • Loading branch information
lociii authored Aug 20, 2024
2 parents b882085 + 9fb82ed commit 9039515
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django_scrubber/management/commands/scrub_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def handle(self, *args, **options):
print(f"- {field}")
found_fields += 1

print(f'{found_models} model(s) having {found_fields} unscrubbed field(s) detected.')
sys.exit(1)
if found_models > 0 or found_fields > 0:
print(f'{found_models} model(s) having {found_fields} unscrubbed field(s) detected.')
sys.exit(1)

print('No unscrubbed fields detected. Yeah!')

0 comments on commit 9039515

Please sign in to comment.