Skip to content

Commit

Permalink
Use explicit type check instead of duck typing
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Jul 24, 2019
1 parent 78ba108 commit d5c5ac5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
---------

5.4.0 (unreleased)
******************

Changes:

* Use explicit type check for `fields.DelimitedList` when deciding to
parse value with `getlist()` (`#406 (comment) <https://github.com/marshmallow-code/webargs/issues/406#issuecomment-514446228>`_ ).

Support:

* Add "Parsing Lists in Query Strings" section to docs (:issue:`406`).

5.3.2 (2019-06-19)
******************

Expand Down
6 changes: 5 additions & 1 deletion src/webargs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ class Meta(object):

def is_multiple(field):
"""Return whether or not `field` handles repeated/multi-value arguments."""
return isinstance(field, ma.fields.List) and not hasattr(field, "delimiter")
from webargs import fields # prevent circular import

return isinstance(field, ma.fields.List) and not isinstance(
field, fields.DelimitedList
)


def get_mimetype(content_type):
Expand Down

0 comments on commit d5c5ac5

Please sign in to comment.