moved initialization of _created before FieldDoesNotExist check
Because otherwise we'll get a FieldDoesNotExist error on the field _created.
This commit is contained in:
parent
191a4e569e
commit
79705fbf11
@ -54,11 +54,14 @@ class BaseDocument(object):
|
|||||||
raise TypeError(
|
raise TypeError(
|
||||||
"Multiple values for keyword argument '" + name + "'")
|
"Multiple values for keyword argument '" + name + "'")
|
||||||
values[name] = value
|
values[name] = value
|
||||||
|
|
||||||
__auto_convert = values.pop("__auto_convert", True)
|
__auto_convert = values.pop("__auto_convert", True)
|
||||||
|
|
||||||
# 399: set default values only to fields loaded from DB
|
# 399: set default values only to fields loaded from DB
|
||||||
__only_fields = set(values.pop("__only_fields", values))
|
__only_fields = set(values.pop("__only_fields", values))
|
||||||
|
|
||||||
|
_created = values.pop("_created", True)
|
||||||
|
|
||||||
signals.pre_init.send(self.__class__, document=self, values=values)
|
signals.pre_init.send(self.__class__, document=self, values=values)
|
||||||
|
|
||||||
# Check if there are undefined fields supplied, if so raise an
|
# Check if there are undefined fields supplied, if so raise an
|
||||||
@ -77,7 +80,6 @@ class BaseDocument(object):
|
|||||||
self._data = SemiStrictDict.create(
|
self._data = SemiStrictDict.create(
|
||||||
allowed_keys=self._fields_ordered)()
|
allowed_keys=self._fields_ordered)()
|
||||||
|
|
||||||
_created = values.pop("_created", True)
|
|
||||||
self._data = {}
|
self._data = {}
|
||||||
self._dynamic_fields = SON()
|
self._dynamic_fields = SON()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user