]> git.parisson.com Git - teleforma.git/commitdiff
add poster_file_s3
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Tue, 4 Aug 2026 13:11:57 +0000 (15:11 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Tue, 4 Aug 2026 13:11:57 +0000 (15:11 +0200)
teleforma/management/commands/teleforma-import-conferences-4.py

index ed35c863121006b8219c8d18d76f4bfa61587035..a2faf9dac81ad063c7e656a5a4b1d426d4a1f132 100644 (file)
@@ -90,15 +90,25 @@ class Command(BaseCommand):
                     media.course_type = conference.course_type
                     media.type = media_format
                     media.is_published = False
+
                     media.file = media_file.replace(settings.MEDIA_ROOT, "")
                     media.save()
                     filename = os.path.split(media_file)[1]
                     with open(media_file, 'rb') as f:
                         media.file_s3.save(filename, File(f))
+                    media.save()
                     media.set_mime_type()
+                    conference.imported = True
+                    logger.logger.info(media_file)
+
                     media.poster_file = poster_file.replace(settings.MEDIA_ROOT, "")
                     media.save()
-                    logger.logger.info(media_file)
+                    filename = os.path.split(poster_file)[1]
+                    with open(poster_file, 'rb') as f:
+                        media.poster_file_s3.save(filename, File(f))
+                    media.save()
+                    conference.s3_exported = True
+                    logger.logger.info(poster_file)
 
                 conference.imported = True
                 conference.save()