Loading resources/models.py +5 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,11 @@ class Project(models.Model): def __str__(self): return self.label @property def root_collection(self) -> "Collection": col, _ = Collection.objects.get_or_create(project=self, parent=None) return col class Tag(models.Model): uid = models.TextField() Loading rpc/methods.py +1 −1 Original line number Diff line number Diff line Loading @@ -490,7 +490,7 @@ def add_collection_from_path(user: User, path: str, project_id: int) -> List[Dic raise ServiceException(NO_SUCH_PROJECT) _check_project_permission(user, project, PERM_COLLECTION_CREATE) hierarchy = [] previous_dir = Collection.objects.get(parent=None, project=project) previous_dir = project.root_collection for dir_name in path.split("/"): # force ascii representation of unicode strings dir_name = unidecode.unidecode(dir_name.strip()) Loading rpc/views.py +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ def _collection_from_origin_dir( origin_dir: str, project: models.Project ) -> Union[models.Collection, None]: # root dir always first previous_dir = models.Collection.objects.get(title="root", parent=None) previous_dir = project.root_collection for dir_name in origin_dir.split("/"): dir_name = dir_name.strip() if not dir_name: Loading Loading
resources/models.py +5 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,11 @@ class Project(models.Model): def __str__(self): return self.label @property def root_collection(self) -> "Collection": col, _ = Collection.objects.get_or_create(project=self, parent=None) return col class Tag(models.Model): uid = models.TextField() Loading
rpc/methods.py +1 −1 Original line number Diff line number Diff line Loading @@ -490,7 +490,7 @@ def add_collection_from_path(user: User, path: str, project_id: int) -> List[Dic raise ServiceException(NO_SUCH_PROJECT) _check_project_permission(user, project, PERM_COLLECTION_CREATE) hierarchy = [] previous_dir = Collection.objects.get(parent=None, project=project) previous_dir = project.root_collection for dir_name in path.split("/"): # force ascii representation of unicode strings dir_name = unidecode.unidecode(dir_name.strip()) Loading
rpc/views.py +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ def _collection_from_origin_dir( origin_dir: str, project: models.Project ) -> Union[models.Collection, None]: # root dir always first previous_dir = models.Collection.objects.get(title="root", parent=None) previous_dir = project.root_collection for dir_name in origin_dir.split("/"): dir_name = dir_name.strip() if not dir_name: Loading