Skip to content

Commit 5768a5a

Browse files
authored
Merge pull request #285 from thenx/fix-280
Fix #280
2 parents 0645496 + ad046a1 commit 5768a5a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

aiohttp_admin/backends/mongo_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def apply_trafaret(trafaret, value):
5959
validate = trafaret.converter
6060

6161
if isinstance(value, list):
62-
value = [validate(v) for v in value]
62+
try:
63+
value = validate(value)
64+
except t.DataError:
65+
value = [validate(v) for v in value]
6366
else:
6467
value = validate(value)
6568
return value

0 commit comments

Comments
 (0)