From 3977ab9ec30a7908de1bafc1cba69bb69a92fda0 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 23 May 2020 16:42:59 +0200 Subject: [PATCH] Fix CD import --- media/management/commands/import_cds.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/media/management/commands/import_cds.py b/media/management/commands/import_cds.py index 67c60bc..d783a12 100644 --- a/media/management/commands/import_cds.py +++ b/media/management/commands/import_cds.py @@ -3,7 +3,7 @@ from sys import stdin from django.core.management import BaseCommand -from media.models import Auteur, Vinyle +from media.models import Auteur, CD class Command(BaseCommand): @@ -27,12 +27,12 @@ class Command(BaseCommand): if len(cd) != 3: continue - side = cd[0] - title = cd[1] + title = cd[0] + side = cd[1] authors_str = cd[2].split('|') authors = [Auteur.objects.get_or_create(name=author)[0] for author in authors_str] - cd, created = Vinyle.objects.get_or_create( + cd, created = CD.objects.get_or_create( title=title, side_identifier=side, )