From 07270beb43c589dd722b14445b513eae68ab2e5b Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Wed, 18 May 2022 17:22:22 -0400 Subject: [PATCH] Do not set traitlet until the end --- .../default/plugins/metadata_viewer/metadata_viewer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdaviz/configs/default/plugins/metadata_viewer/metadata_viewer.py b/jdaviz/configs/default/plugins/metadata_viewer/metadata_viewer.py index f683217bfe..4109912e31 100644 --- a/jdaviz/configs/default/plugins/metadata_viewer/metadata_viewer.py +++ b/jdaviz/configs/default/plugins/metadata_viewer/metadata_viewer.py @@ -75,7 +75,7 @@ def find_public_metadata(self, meta, primary_only=False): del d[badkey] if COMMENTCARD_KEY in meta: - self.has_comments = True + has_comments = True def get_comment(key): if key in meta[COMMENTCARD_KEY]._header: @@ -84,7 +84,7 @@ def get_comment(key): val = '' return val else: - self.has_comments = False + has_comments = False def get_comment(key): return '' @@ -94,9 +94,9 @@ def get_comment(key): if len(public_meta) > 0: self.metadata = public_meta self.has_metadata = True + self.has_comments = has_comments else: - self.metadata = [] - self.has_metadata = False + self.reset() # TODO: If this is natively supported by asdf in the future, replace with native function.