Skip to content

Commit

Permalink
Enhance ted create_ted_topics maint script
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Jul 15, 2024
1 parent a040ffe commit 30fbe76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dispatcher/backend/maint-scripts/create_ted_topics_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from http import HTTPStatus

import requests

from get_token import get_token, get_token_headers, get_url

logging.basicConfig(
Expand Down Expand Up @@ -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}"),
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 30fbe76

Please sign in to comment.