Oprava testovacich dat pro nove Django

This commit is contained in:
Tomas "Jethro" Pokorny 2019-05-16 21:15:18 +02:00
parent f92eeb8450
commit 4819c0fd6a

View file

@ -4,7 +4,7 @@ import datetime
import os
import random
from django.core.management.base import NoArgsCommand
from django.core.management.base import BaseCommand
from django.core.management import call_command
from django.conf import settings
@ -14,10 +14,10 @@ import django.contrib.auth
User = django.contrib.auth.get_user_model()
class Command(NoArgsCommand):
class Command(BaseCommand):
help = "Clear database and load testing data."
def handle_noargs(self, **options):
def handle(self, **options):
assert settings.DEBUG == True
dbfile = settings.DATABASES['default']['NAME']
if os.path.exists(dbfile):