diff --git a/rangefilter/filter.py b/rangefilter/filter.py index 120f2f6..91015db 100644 --- a/rangefilter/filter.py +++ b/rangefilter/filter.py @@ -54,7 +54,10 @@ def make_dt_aware(value, timezone): def choices(self, cl): yield { - 'system_name': slugify(self.title), + # slugify converts any non-unicode characters to empty characters + # but system_name is required, if title converts to empty string use id + # https://github.com/silentsokolov/django-admin-rangefilter/issues/18 + 'system_name': slugify(self.title) if slugify(self.title) else id(self.title), 'query_string': cl.get_query_string( {}, remove=self._get_expected_fields() )