Skip to content

Commit

Permalink
When value is a list it should be returned as is
Browse files Browse the repository at this point in the history
This change should help close carltongibson#1103
  • Loading branch information
tony13tv committed Mar 7, 2021
1 parent b1e37af commit 4c4d3f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django_filters/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ def value_from_datadict(self, data, files, name):
if value is not None:
if value == '': # empty value should parse as an empty list
return []
if isinstance(value, list):
# since django.forms.widgets.SelectMultiple tries to use getlist
# if available, we should return value if it's already an array
return value
return value.split(',')
return None

Expand Down

0 comments on commit 4c4d3f6

Please sign in to comment.