From 47df8deb58add4a7b93dedcc9da61be0be722d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristinn=20O=CC=88rn=20Sigur=C3=B0sson?= Date: Thu, 4 Apr 2013 17:30:21 +0200 Subject: [PATCH] Fix the implementation. --- mongoengine/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoengine/base.py b/mongoengine/base.py index c2d74f3d..42091568 100644 --- a/mongoengine/base.py +++ b/mongoengine/base.py @@ -1207,7 +1207,7 @@ class BaseDocument(object): # Determine if any changed items were actually unset. for path, value in set_data.items(): - if value or isinstance(value, bool) or isinstance(value, int): + if value or type(value) in [bool, int]: continue # If we've set a value that ain't the default value dont unset it.