Skip to content

Commit 8739ab9

Browse files
author
Erdenezul Batmunkh
committed
fix syntax #1338
1 parent e8e47c3 commit 8739ab9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mongoengine/document.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def _get_collection(cls):
196196
# Ensure indexes on the collection unless auto_create_index was
197197
# set to False.
198198
# Also there is no need to ensure indexes on slave.
199+
db = cls._get_db()
199200
if cls._meta.get('auto_create_index', True) and\
200201
db.client.is_primary:
201202
cls.ensure_indexes()

0 commit comments

Comments
 (0)