@@ -658,21 +658,22 @@ def _call_method(self, method, obj, default, default_is_exception, **kwargs):
658658 return default
659659
660660 def __get_store_id_for (self , obj , ** kwargs ):
661- if obj .object_store_id is not None and obj .object_store_id in self .backends :
662- return obj .object_store_id
663- else :
664- # if this instance has been switched from a non-distributed to a
665- # distributed object store, or if the object's store id is invalid,
666- # try to locate the object
667- log .warning ('The backend object store ID (%s) for %s object with ID %s is invalid'
668- % (obj .object_store_id , obj .__class__ .__name__ , obj .id ))
669- for id , store in self .backends .items ():
670- if store .exists (obj , ** kwargs ):
671- log .warning ('%s object with ID %s found in backend object store with ID %s'
672- % (obj .__class__ .__name__ , obj .id , id ))
673- obj .object_store_id = id
674- _create_object_in_session (obj )
675- return id
661+ if obj .object_store_id is not None :
662+ if obj .object_store_id in self .backends :
663+ return obj .object_store_id
664+ else :
665+ log .warning ('The backend object store ID (%s) for %s object with ID %s is invalid'
666+ % (obj .object_store_id , obj .__class__ .__name__ , obj .id ))
667+ # if this instance has been switched from a non-distributed to a
668+ # distributed object store, or if the object's store id is invalid,
669+ # try to locate the object
670+ for id , store in self .backends .items ():
671+ if store .exists (obj , ** kwargs ):
672+ log .warning ('%s object with ID %s found in backend object store with ID %s'
673+ % (obj .__class__ .__name__ , obj .id , id ))
674+ obj .object_store_id = id
675+ _create_object_in_session (obj )
676+ return id
676677 return None
677678
678679
0 commit comments