diff --git a/JugarAlPadel/gestion_reservas/eventos/management/commands/importar_noticias.py b/JugarAlPadel/gestion_reservas/eventos/management/commands/importar_noticias.py index d20196b..b5e05d1 100644 --- a/JugarAlPadel/gestion_reservas/eventos/management/commands/importar_noticias.py +++ b/JugarAlPadel/gestion_reservas/eventos/management/commands/importar_noticias.py @@ -27,10 +27,10 @@ class Command(BaseCommand): noticias_creados = 0 for noticia_data in datos: try: - usuario = ReyMotaUser.objects.get(id=noticia_data["usuario"]) + usuario = ReyMotaUser.objects.get(email=noticia_data["usuario_email"]) creado = Noticia.objects.create( - autor_id=usuario.id, + autor=usuario, titulo=noticia_data['titulo'], fecha_publicacion=noticia_data['fecha_publicacion'], publicado=noticia_data['publicado']