File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 1414- Use new update_one, update_many on document/queryset update #1491
1515- Use insert_one, insert_many in Document.insert #1491
1616- Fix reload(fields) affect changed fields #1371
17+ - Fix Read-only access to database fails when trying to create indexes #1338
1718
1819Changes in 0.15.0
1920=================
Original file line number Diff line number Diff line change @@ -195,7 +195,10 @@ def _get_collection(cls):
195195
196196 # Ensure indexes on the collection unless auto_create_index was
197197 # set to False.
198- if cls ._meta .get ('auto_create_index' , True ):
198+ # Also there is no need to ensure indexes on slave.
199+ db = cls ._get_db ()
200+ if cls ._meta .get ('auto_create_index' , True ) and \
201+ db .client .is_primary :
199202 cls .ensure_indexes ()
200203
201204 return cls ._collection
You can’t perform that action at this time.
0 commit comments