Skip to content

Commit

Permalink
Don't break on missing categories #2 (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
squeaky-pl committed Mar 16, 2023
1 parent 9a785f0 commit 0283770
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions inbox/api/kellogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def format_categories(categories):
"display_name": category.api_display_name,
}
for category in categories
if category
]


Expand All @@ -50,12 +51,13 @@ def format_messagecategories(messagecategories):
return []
return [
{
"id": mc.category.public_id,
"name": mc.category.name or None,
"display_name": mc.category.api_display_name,
"created_timestamp": mc.created_at,
"id": message_category.category.public_id,
"name": message_category.category.name or None,
"display_name": message_category.category.api_display_name,
"created_timestamp": message_category.created_at,
}
for mc in messagecategories
for message_category in messagecategories
if message_category.category
]


Expand Down

0 comments on commit 0283770

Please sign in to comment.