Fix `KeyError` raised by `django-rangefilter`.

master
Fabio Caccamo 2022-10-13 11:53:20 +02:00
parent 5ffd77ef0b
commit 3f46d3aa32
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ def admin_interface_filter_removal_link(changelist, list_filter):
tpl = get_template('admin_interface/list_filter_removal_link.html')
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:
value = choices[0]['display']
except (IndexError, KeyError):