'Override `ObjectStore`\'s stub.
If `object_store_check_old_style` is set to `True` in config then the
root path is checked first.'

def get_filename(self, obj, **kwargs):

    if self.check_old_style:
        path = self._construct_path(obj, old_style=True, **kwargs)
        if os.path.exists(path):
            return path
    return self._construct_path(obj, **kwargs)
