From d5c5ac5f12777182393681ddb884e53938167bce Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 23 Jul 2019 22:38:51 -0400 Subject: [PATCH] Use explicit type check instead of duck typing See https://github.com/marshmallow-code/webargs/issues/406#issuecomment-514379744 --- CHANGELOG.rst | 12 ++++++++++++ src/webargs/core.py | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2c9f5ca1..ade17396 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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) `_ ). + +Support: + +* Add "Parsing Lists in Query Strings" section to docs (:issue:`406`). + 5.3.2 (2019-06-19) ****************** diff --git a/src/webargs/core.py b/src/webargs/core.py index b4b2fb37..2f4a5be7 100644 --- a/src/webargs/core.py +++ b/src/webargs/core.py @@ -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):