diff --git a/contentcuration/kolibri_public/management/commands/export_channels_to_kolibri_public.py b/contentcuration/kolibri_public/management/commands/export_channels_to_kolibri_public.py index f20206abf0..b4b88ab4ba 100644 --- a/contentcuration/kolibri_public/management/commands/export_channels_to_kolibri_public.py +++ b/contentcuration/kolibri_public/management/commands/export_channels_to_kolibri_public.py @@ -46,10 +46,13 @@ def _republish_problem_channels(self): ) for channel in channel_qs: - kolibri_temp_db = create_content_database(channel, True, chef_user.id, False) - os.remove(kolibri_temp_db) - channel.last_published = timezone.now() - channel.save() + try: + kolibri_temp_db = create_content_database(channel, True, chef_user.id, False) + os.remove(kolibri_temp_db) + channel.last_published = timezone.now() + channel.save() + except Exception as e: + logger.exception("Failed to export channel {} to kolibri_public because of error: {}".format(channel.id, e)) def _export_channel(self, channel_id): logger.info("Putting channel {} into kolibri_public".format(channel_id))