Jelajahi Sumber

El campo usuario en los datos json se llama autor

creylopez 1 tahun lalu
induk
melakukan
7d9013e38b
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/eventos/management/commands/importar_noticias.py

+ 1 - 1
src/eventos/management/commands/importar_noticias.py

@@ -27,7 +27,7 @@ class Command(BaseCommand):
             noticias_creados = 0
             noticias_creados = 0
             for noticia_data in datos:
             for noticia_data in datos:
                 try:
                 try:
-                    usuario = ReyMotaUser.objects.get(id=noticia_data["usuario"])
+                    usuario = ReyMotaUser.objects.get(id=noticia_data["autor"])
 
 
                     creado = Noticia.objects.create(
                     creado = Noticia.objects.create(
                         autor_id=usuario.id,
                         autor_id=usuario.id,