small optimizing fix
This commit is contained in:
parent
823cf421fa
commit
08288e591c
@ -81,10 +81,10 @@ class Document(BaseDocument):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _get_collection(self):
|
def _get_collection(self):
|
||||||
"""Returns the collection for the document."""
|
"""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:
|
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
|
# Create collection as a capped collection if specified
|
||||||
if self._meta['max_size'] or self._meta['max_documents']:
|
if self._meta['max_size'] or self._meta['max_documents']:
|
||||||
# Get max document limit and max byte size from meta
|
# Get max document limit and max byte size from meta
|
||||||
|
Loading…
x
Reference in New Issue
Block a user