Commit 7aae4337 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

fix exception

parent dce7e285
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ def _db_obj_from_path(path: str, ttl_hash=None):
        except ValueError:
            return
        if not ext:
            return Collection.objects.get(pk=pk)
            return Collection.objects.filter(pk=pk).first()
        else:
            return Resource.objects.get(pk=pk)
            return Resource.objects.filter(pk=pk).first()
    return


@@ -45,9 +45,11 @@ class Ops(Operations):

        ex_collection-2/other_col-23/more_col-43/some_pic-374.jpg
        """
        if path == "/":
            return self.root_collection
        obj = _db_obj_from_path(path, ttl_hash=get_ttl_hash())
        if not obj:
            return self.root_collection
            raise FuseOSError(errno.ENOENT)
        else:
            return obj