Fix merge of PR #747

This commit is contained in:
Yohan Graterol
2014-08-27 11:14:43 -05:00
2 changed files with 4 additions and 1 deletions

View File

@@ -594,7 +594,9 @@ class Document(BaseDocument):
index_cls = cls._meta.get('index_cls', True)
collection = cls._get_collection()
if collection.read_preference > 1:
# 746: when connection is via mongos, the read preference is not necessarily an indication that
# this code runs on a secondary
if not collection.is_mongos and collection.read_preference > 1:
return
# determine if an index which we are creating includes