Add a command that clean logs

This commit is contained in:
Rodolphe Breard 2018-06-09 19:01:36 +02:00
parent 0c29381351
commit 7fe6c91bed
3 changed files with 11 additions and 0 deletions

View file

View file

View file

@ -0,0 +1,11 @@
from django.core.management.base import BaseCommand, CommandError
from logs.models import Entry
class Command(BaseCommand):
help = 'Generates the CSS files used by Pygments'
def handle(self, *args, **options):
for e in Entry.objects.all():
if not e.created:
e.delete()