core -- Apply black + isort to all files
This commit is contained in:
parent
104e71dcf6
commit
fdd2b35289
196 changed files with 10727 additions and 8365 deletions
|
@ -1,7 +1,6 @@
|
|||
from django.contrib.auth.models import Group
|
||||
from django.core.management import call_command
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from wagtail.wagtailcore.models import Page, Site
|
||||
|
||||
|
||||
|
@ -9,7 +8,7 @@ class Command(BaseCommand):
|
|||
help = "Importe des données pour Wagtail"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('--file', default='kfet_wagtail_17_05')
|
||||
parser.add_argument("--file", default="kfet_wagtail_17_05")
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
|
@ -18,12 +17,10 @@ class Command(BaseCommand):
|
|||
# Nettoyage des données initiales posées par Wagtail dans la migration
|
||||
# wagtailcore/0002
|
||||
|
||||
Group.objects.filter(name__in=('Moderators', 'Editors')).delete()
|
||||
Group.objects.filter(name__in=("Moderators", "Editors")).delete()
|
||||
|
||||
try:
|
||||
homepage = Page.objects.get(
|
||||
title="Welcome to your new Wagtail site!"
|
||||
)
|
||||
homepage = Page.objects.get(title="Welcome to your new Wagtail site!")
|
||||
homepage.delete()
|
||||
Site.objects.filter(root_page=homepage).delete()
|
||||
except Page.DoesNotExist:
|
||||
|
@ -32,4 +29,4 @@ class Command(BaseCommand):
|
|||
# Import des données
|
||||
# Par défaut, il s'agit d'une copie du site K-Fêt (17-05)
|
||||
|
||||
call_command('loaddata', options['file'])
|
||||
call_command("loaddata", options["file"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue