From 53e6fcf9890cfe177e946b6fd7aa25b03debddc1 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sat, 3 Jul 2010 13:28:14 +0200 Subject: [PATCH] properly encode validation errors --- pyweb/extdirect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyweb/extdirect.py b/pyweb/extdirect.py index 5b00e2d..0a8bcd0 100644 --- a/pyweb/extdirect.py +++ b/pyweb/extdirect.py @@ -443,7 +443,10 @@ class Provider( object ): forminst.save() return { 'success': True } else: - return { 'success': False } + errdict = {} + for errfld in forminst.errors: + errdict[errfld] = "\n".join( forminst.errors[errfld] ) + return { 'success': False, 'errors': errdict } @property def urls(self):