}
}
-CACHE_TIMEOUT = 60*60*12
+CACHE_TIMEOUT = 60*60*24
# Name of cache backend to cache user agents. If it not specified default
# cache alias will be used. Set to `None` to disable caching.
volumes:
- /mnt/crfpa-videos:/mnt/crfpa-videos
- /mnt/crfpa-scripts:/mnt/crfpa-scripts
- ports:
- - "9003:8000"
networks:
- teleforma-prod
- ./lib:/srv/lib
- ./teleforma/:/srv/src/teleforma/teleforma
- ./var/log/app:/var/log/app
- ports:
- - "9004:8000"
env_file:
- env/prod.env
networks:
networks:
teleforma-prod:
- driver: bridge
\ No newline at end of file
+ driver: bridge
period_name = options['period']
period = Period.objects.get(name=period_name)
+ now_minus = datetime.datetime.now() - datetime.timedelta(minutes=5)
+ print(now_minus)
+ now_plus = datetime.datetime.now() + datetime.timedelta(minutes=1)
+ print(now_plus)
+
conferences = Conference.objects.filter(
period=period,
status=2,
notified=False,
- date_publish__lte=datetime.datetime.now()
+ date_publish__lte=now_plus,
+ date_publish__gte=now_minus,
)
for conference in conferences:
conference.status = 3
conference.save()
+ medias = conference.media.all()
+ for media in medias:
+ media.is_published = True
+ media.save()
+ if "video/mp4" in media.mime_type:
+ linked_media = media
logger.logger.info("Conference published: " + conference.public_id)
media = conference.media.filter(mime_type='video/mp4')[0]
- url = reverse('teleforma-media-detail', args=[conference.period.id, media.id])
+ url = reverse('teleforma-media-detail', args=[conference.period.id, linked_media.id])
message = "Nouvelle conférence publiée : " + str(conference)
students = Student.objects.filter(period=conference.period)