Skip to content

Commit

Permalink
remove redundant isinstance check for metadata & app_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bcwu committed Apr 19, 2023
1 parent c574091 commit 99f9ac4
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions rsconnect/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@ def __init__(
if environment:
self.data["locale"] = environment.locale

if metadata and isinstance(metadata, dict):
self.data["metadata"] = metadata
elif metadata and not isinstance(metadata, dict):
raise TypeError("metadata must be a dictionary.")
else:
if metadata is None:
self.data["metadata"] = {}
if isinstance(app_mode, AppMode):
self.data["metadata"]["appmode"] = app_mode.name()
else:
if app_mode is None:
self.data["metadata"]["appmode"] = AppModes.UNKNOWN
else:
self.data["metadata"]["appmode"] = app_mode.name()
else:
self.data["metadata"] = metadata

if primary_html:
self.data["metadata"]["primary_html"] = primary_html
Expand Down

0 comments on commit 99f9ac4

Please sign in to comment.