From d36f6e7f24d5fc22076fc192d6f3174b0c1ee58c Mon Sep 17 00:00:00 2001 From: zmolodchenko Date: Sat, 9 Mar 2013 21:08:10 +0200 Subject: [PATCH] fix error reporting, where choices is list of flat values --- mongoengine/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoengine/base.py b/mongoengine/base.py index 013afe78..f73af4cc 100644 --- a/mongoengine/base.py +++ b/mongoengine/base.py @@ -252,7 +252,7 @@ class BaseField(object): elif value_to_check not in self.choices: msg = ('Value must be %s of %s' % (err_msg, unicode(self.choices))) - self.error() + self.error(msg) # check validation argument if self.validation is not None: