diff --git a/lib/charms/grafana_k8s/v0/grafana_source.py b/lib/charms/grafana_k8s/v0/grafana_source.py index f289f659..883f313f 100644 --- a/lib/charms/grafana_k8s/v0/grafana_source.py +++ b/lib/charms/grafana_k8s/v0/grafana_source.py @@ -679,7 +679,7 @@ def _remove_source_from_datastore(self, event: RelationDepartedEvent) -> bool: # remove this datasource name from the published datasource names shared with the datasource units self._publish_source_uids( - event.relation, {ds["unit"]: ds["source_name"] for ds in stored_sources[rel_id]} + event.relation, {ds["unit"]: ds["source_name"] for ds in removed_source} ) return True