@@ -656,21 +656,22 @@ def _call_method(self, method, obj, default, default_is_exception, **kwargs):
656656 return default
657657
658658 def __get_store_id_for (self , obj , ** kwargs ):
659- if obj .object_store_id is not None and obj .object_store_id in self .backends :
660- return obj .object_store_id
661- else :
662- # if this instance has been switched from a non-distributed to a
663- # distributed object store, or if the object's store id is invalid,
664- # try to locate the object
665- log .debug ('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- for id , store in self .backends .items ():
668- if store .exists (obj , ** kwargs ):
669- log .warning ('%s object with ID %s found in backend object store with ID %s'
670- % (obj .__class__ .__name__ , obj .id , id ))
671- obj .object_store_id = id
672- _create_object_in_session (obj )
673- return id
659+ if obj .object_store_id is not None :
660+ if obj .object_store_id in self .backends :
661+ return obj .object_store_id
662+ else :
663+ log .warning ('The backend object store ID (%s) for %s object with ID %s is invalid'
664+ % (obj .object_store_id , obj .__class__ .__name__ , obj .id ))
665+ # if this instance has been switched from a non-distributed to a
666+ # distributed object store, or if the object's store id is invalid,
667+ # try to locate the object
668+ for id , store in self .backends .items ():
669+ if store .exists (obj , ** kwargs ):
670+ log .warning ('%s object with ID %s found in backend object store with ID %s'
671+ % (obj .__class__ .__name__ , obj .id , id ))
672+ obj .object_store_id = id
673+ _create_object_in_session (obj )
674+ return id
674675 return None
675676
676677
0 commit comments