Skip to content

Commit

Permalink
Review improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jjkester committed Sep 7, 2020
1 parent 7bb17fd commit 5652391
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions auditlog/management/commands/auditlogflush.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def add_arguments(self, parser):
def handle(self, *args, **options):
answer = options['yes']

while answer is None:
print("This action will clear all log entries from the database.")
if answer is None:
self.stdout.write("This action will clear all log entries from the database.")
response = input("Are you sure you want to continue? [y/N]: ").lower().strip()
answer = True if response == 'y' else False if response == 'n' else None
answer = response == 'y'

if answer:
count, _ = LogEntry.objects.all().delete()
print("Deleted %d objects." % count)
self.stdout.write("Deleted %d objects." % count)
else:
print("Aborted.")
self.stdout.write("Aborted.")

0 comments on commit 5652391

Please sign in to comment.