diff --git a/muse_for_music/models/helper_classes.py b/muse_for_music/models/helper_classes.py index c6cb8da..12e3dbc 100644 --- a/muse_for_music/models/helper_classes.py +++ b/muse_for_music/models/helper_classes.py @@ -225,10 +225,14 @@ def _update_updateable_model_list(self, item_list: Sequence[dict], if to_delete: db.session.expire(self) - def update_list(self, item_list: Union[Sequence[int], Sequence[dict]], + def update_list(self, item_list: Union[Sequence[int], Sequence[dict], None], old_items: Union[Dict[int, K], Dict[int, W]], mapping_cls: Any, item_cls: Type[V] = None, mapping_cls_attribute: str = None): + # consider None an empty list + if item_list is None: + item_list = tuple() + if issubclass(mapping_cls, UpdateableModelMixin): self._update_updateable_model_list(item_list, old_items, mapping_cls) elif issubclass(item_cls, GetByID) and item_cls is not None and mapping_cls_attribute: