From 08288e591cf39c635c26d5f566ecd467f600b258 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Fri, 30 Sep 2011 08:22:33 +0300 Subject: [PATCH] small optimizing fix --- mongoengine/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mongoengine/document.py b/mongoengine/document.py index 81c288ef..e9b8871e 100644 --- a/mongoengine/document.py +++ b/mongoengine/document.py @@ -81,10 +81,10 @@ class Document(BaseDocument): @classmethod def _get_collection(self): """Returns the collection for the document.""" - db = _get_db() - collection_name = self._get_collection_name() if not hasattr(self, '_collection') or self._collection is None: + db = _get_db() + collection_name = self._get_collection_name() # Create collection as a capped collection if specified if self._meta['max_size'] or self._meta['max_documents']: # Get max document limit and max byte size from meta