def update_video_index(sender, instance=None, created=False, **kwargs): if TEST_SETTINGS or ES_URL is None: return if instance.is_draft is False and instance.encoding_in_progress is False: index_es(instance) else: delete_es(instance)
def manage_es(self, video_id): try: video = Video.objects.get(pk=video_id) if video.is_draft is False: index_es(video) self.stdout.write( self.style.SUCCESS('Successfully index Video "%s"' % video_id)) else: delete_es(video) except Video.DoesNotExist: self.stdout.write( self.style.ERROR('Video "%s" does not exist' % video_id))
def update_video_index(sender, instance=None, created=False, **kwargs): if instance.is_draft is False and instance.encoding_in_progress is False: index_es(instance) else: delete_es(instance)
def delete_video_index(sender, instance=None, created=False, **kwargs): delete_es(instance)
def delete_video_index(sender, instance=None, created=False, **kwargs): if TEST_SETTINGS or ES_URL is None: return delete_es(instance)
def index_video(video): if video.is_draft is False and video.encoding_in_progress is False: index_es(video) else: delete_es(video)