From 30fbe76e880278089f57b4a53bb1fbfb6ea34ba4 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Mon, 15 Jul 2024 09:13:48 +0000 Subject: [PATCH] Enhance ted create_ted_topics maint script --- .../backend/maint-scripts/create_ted_topics_recipes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dispatcher/backend/maint-scripts/create_ted_topics_recipes.py b/dispatcher/backend/maint-scripts/create_ted_topics_recipes.py index 9e7a9653..d33859dd 100644 --- a/dispatcher/backend/maint-scripts/create_ted_topics_recipes.py +++ b/dispatcher/backend/maint-scripts/create_ted_topics_recipes.py @@ -5,7 +5,6 @@ from http import HTTPStatus import requests - from get_token import get_token, get_token_headers, get_url logging.basicConfig( @@ -49,7 +48,7 @@ def get_ted_topics(): def create_recipe(ted_topic_name: str, access_token): - clean_ted_topic_name = ted_topic_name.replace(" ", "-") + clean_ted_topic_name = ted_topic_name.replace(" ", "-").replace("'", "") schedule_name = f"ted_topic_{clean_ted_topic_name}" response = requests.get( get_url(f"/schedules/{schedule_name}"), @@ -125,7 +124,8 @@ def main(zf_username, zf_password): access_token, refresh_token = get_token(zf_username, zf_password) ted_topics = get_ted_topics() - logger.debug(ted_topics) + logger.debug(",".join((ted_topics))) + logger.debug(",".join(sorted(ted_topics))) for topic in ted_topics: if topic != "street art": continue