Stop ensure_indexes running on a secondaries (#555)

This commit is contained in:
Ross Lawley 2014-01-24 13:17:52 +00:00
parent 708dbac70e
commit 0277062693
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,10 @@
Changelog Changelog
========= =========
Changes in 0.8.7
================
- Stop ensure_indexes running on a secondaries (#555)
Changes in 0.8.6 Changes in 0.8.6
================ ================
- Fix django auth import (#531) - Fix django auth import (#531)

View File

@ -549,6 +549,8 @@ class Document(BaseDocument):
index_cls = cls._meta.get('index_cls', True) index_cls = cls._meta.get('index_cls', True)
collection = cls._get_collection() collection = cls._get_collection()
if collection.read_preference > 1:
return
# determine if an index which we are creating includes # determine if an index which we are creating includes
# _cls as its first field; if so, we can avoid creating # _cls as its first field; if so, we can avoid creating