From 3b9c039791991be2b01693c9c561fbcd82ad7564 Mon Sep 17 00:00:00 2001 From: Serg Tereshchenko Date: Thu, 26 May 2022 22:05:17 +0300 Subject: [PATCH] fix: Properly set attributes for auto created field --- django_mongoengine/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_mongoengine/document.py b/django_mongoengine/document.py index ffde50e..257f74d 100644 --- a/django_mongoengine/document.py +++ b/django_mongoengine/document.py @@ -14,7 +14,7 @@ # TopLevelDocumentMetaclass is using ObjectIdField to create default pk field, # if one's not set explicitly. # We need to know it's not editable and auto_created. -#mtc.ObjectIdField = partial(ObjectIdField, editable=False, auto_created=True) +mtc.ObjectIdField = partial(ObjectIdField, editable=False, auto_created=True, blank=True) def django_meta(meta, *top_bases):