Skip to content

Commit

Permalink
ignore character case when looking up categories
Browse files Browse the repository at this point in the history
  • Loading branch information
cwar committed Mar 6, 2024
1 parent 24533b3 commit 56f7596
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/doesthedogdie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 56f7596

Please sign in to comment.