Skip to content

Commit

Permalink
Fix system name with non-unicode char (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
silentsokolov committed Jun 29, 2018
1 parent f034660 commit 4a50779
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rangefilter/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand Down

0 comments on commit 4a50779

Please sign in to comment.