small optimizing fix
This commit is contained in:
parent
823cf421fa
commit
08288e591c
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue