Change auditlogflush management command before_date query filter to apply the filter only on date part of timestamp (#384)

This commit is contained in:
Hasan Ramezani 2022-06-08 16:47:13 +02:00 committed by GitHub
parent 128555fa29
commit 2e9466d1b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ class Command(BaseCommand):
if answer:
entries = LogEntry.objects.all()
if before is not None:
entries = entries.filter(timestamp__lt=before)
entries = entries.filter(timestamp__date__lt=before)
count, _ = entries.delete()
self.stdout.write("Deleted %d objects." % count)
else: