From c19be65c5bbd8ab9ea562c9d344b6e669b00923e Mon Sep 17 00:00:00 2001 From: "Terence D. Honles" Date: Thu, 31 Aug 2017 14:22:31 -0700 Subject: [PATCH] validate the underlying data type rather than the enum --- extras_mongoengine/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras_mongoengine/fields.py b/extras_mongoengine/fields.py index 7ce8264..67c2f7a 100644 --- a/extras_mongoengine/fields.py +++ b/extras_mongoengine/fields.py @@ -97,7 +97,7 @@ def validate(self, value): def _validate(self, value, **kwargs): return super(EnumField, self)._validate( - self.enum(self.__get_value(value)), **kwargs) + self.__get_value(value), **kwargs) class IntEnumField(EnumField, IntField):