From 56f7596f71d6384726394b6c435ce54e0d6ac547 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 6 Mar 2024 23:25:18 +0000 Subject: [PATCH] ignore character case when looking up categories --- modules/doesthedogdie.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/doesthedogdie.py b/modules/doesthedogdie.py index 113d66793..a45d557f5 100644 --- a/modules/doesthedogdie.py +++ b/modules/doesthedogdie.py @@ -270,11 +270,11 @@ def get_all_topic_ids(cls): @classmethod def get_category_id_by_name(cls, name): - category = cls.category_map.get(name) - if category: - return category["id"] - else: - return None + lowercase_name = name.lower() + for category_name, category in cls.category_map.items(): + if category_name.lower() == lowercase_name: + return category["id"] + return None @classmethod def get_topic_ids_by_category_id(cls, category_id):