Skip to content

Commit

Permalink
add backward capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Nov 20, 2023
1 parent a478890 commit 3801b3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aiidalab_widgets_base/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ def viewer(obj, **kwargs):
if key in AIIDA_VIEWER_MAPPING:
_viewer = AIIDA_VIEWER_MAPPING[key]
return _viewer(obj, **kwargs)
elif isinstance(obj, orm.ProcessNode):
return ProcessNodeViewerWidget(obj, **kwargs)
# backward capacity
elif isinstance(obj, orm.ProcessNode) and obj.node_type in AIIDA_VIEWER_MAPPING:
_viewer = AIIDA_VIEWER_MAPPING[key]
return _viewer(obj, **kwargs)
else:
# No viewer registered for this type, return object itself
return obj
Expand Down

0 comments on commit 3801b3d

Please sign in to comment.