Skip to content

Commit

Permalink
fix: display as value undefined key
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Aug 23, 2022
1 parent b72618a commit 646b9c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-unfold"
version = "0.1.2"
version = "0.1.3"
description = "Clean & minimal Django admin theme based on Tailwind CSS"
license = "MIT"
readme = "README.md"
Expand Down
7 changes: 5 additions & 2 deletions src/unfold/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ def display_for_label(value, empty_value_display, label):

if isinstance(label, dict):
if isinstance(value, tuple):
label_type = label[value[0]]
value = value[1]
try:
label_type = label[value[0]]
value = value[1]
except KeyError:
value = value[0]
elif value in label:
label_type = label[value]
elif isinstance(label, (label, tuple)):
Expand Down

0 comments on commit 646b9c4

Please sign in to comment.