diff --git a/jdaviz/core/template_mixin.py b/jdaviz/core/template_mixin.py index 94d27be48c..05bf37c870 100644 --- a/jdaviz/core/template_mixin.py +++ b/jdaviz/core/template_mixin.py @@ -2026,7 +2026,7 @@ def __init__(self, plugin, items, selected, multiselect=None, selected_has_subre self.hub.subscribe(self, SubsetUpdateMessage, handler=lambda msg: self._update_subset(msg.subset, msg.attribute)) self.hub.subscribe(self, SubsetCreateMessage, - handler=lambda msg: self._update_subset(msg.subset, attribute="type")) + handler=lambda msg: self._update_subset(msg.subset)) self.hub.subscribe(self, SubsetDeleteMessage, handler=lambda msg: self._delete_subset(msg.subset)) self.hub.subscribe(self, SubsetRenameMessage, @@ -2104,7 +2104,8 @@ def _update_subset(self, subset, attribute=None): self.items = self.items + [self._subset_to_dict(subset)] # noqa else: # 'type' can be passed manually rather than coming from SubsetUpdateMessage.attribute - if attribute in ('style', 'type'): + # This will be None if triggered by SubsetCreateMessage + if attribute in ('style', 'type') or attribute is None: # TODO: may need to add label and then rebuild the entire list if/when # we add support for renaming subsets