Fix KeyError raised by django-rangefilter.
This commit is contained in:
@@ -107,7 +107,7 @@ def admin_interface_filter_removal_link(changelist, list_filter):
|
|||||||
tpl = get_template('admin_interface/list_filter_removal_link.html')
|
tpl = get_template('admin_interface/list_filter_removal_link.html')
|
||||||
title = list_filter.title
|
title = list_filter.title
|
||||||
|
|
||||||
choices = [c for c in list_filter.choices(changelist) if c['selected']]
|
choices = [c for c in list_filter.choices(changelist) if c.get("selected")]
|
||||||
try:
|
try:
|
||||||
value = choices[0]['display']
|
value = choices[0]['display']
|
||||||
except (IndexError, KeyError):
|
except (IndexError, KeyError):
|
||||||
|
|||||||
Reference in New Issue
Block a user