Loading src/resources/tasks.py +2 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,8 @@ def recursive_set_metas_to_collection( /!\ *Not* actually recursive: Descendants (sub-collections and sub-collections resources) are IGNORED. """ if not metas: raise ValueError("empty metas list") from rpc.methods import ( remove_meta_value_from_collection, add_meta_to_collection, Loading src/rpc/methods.py +4 −0 Original line number Diff line number Diff line Loading @@ -1480,6 +1480,8 @@ def set_metas_to_resource(user: User, resource_id: int, metas: List[dict]) -> bo All metas must share the same metadata set. """ if not metas: raise ServiceException("empty metas list") # prevent mixing metas from different sets metadatasets_ids = [] for meta_dict in metas: Loading Loading @@ -1534,6 +1536,8 @@ def set_metas_to_collection( async_mode is IGNORED """ # prevent mixing metas from different sets if not metas: raise ServiceException("empty metas list") metadatasets_ids = [] for meta_dict in metas: meta = Metadata.objects.get(pk=meta_dict["id"]) Loading Loading
src/resources/tasks.py +2 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,8 @@ def recursive_set_metas_to_collection( /!\ *Not* actually recursive: Descendants (sub-collections and sub-collections resources) are IGNORED. """ if not metas: raise ValueError("empty metas list") from rpc.methods import ( remove_meta_value_from_collection, add_meta_to_collection, Loading
src/rpc/methods.py +4 −0 Original line number Diff line number Diff line Loading @@ -1480,6 +1480,8 @@ def set_metas_to_resource(user: User, resource_id: int, metas: List[dict]) -> bo All metas must share the same metadata set. """ if not metas: raise ServiceException("empty metas list") # prevent mixing metas from different sets metadatasets_ids = [] for meta_dict in metas: Loading Loading @@ -1534,6 +1536,8 @@ def set_metas_to_collection( async_mode is IGNORED """ # prevent mixing metas from different sets if not metas: raise ServiceException("empty metas list") metadatasets_ids = [] for meta_dict in metas: meta = Metadata.objects.get(pk=meta_dict["id"]) Loading