Skip to content

Commit

Permalink
if else updated from review and. removed comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mpatrou committed Jan 17, 2025
1 parent 8fba387 commit b2111ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pyoncatqt/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ def __init__(
# OnCat agent

self.oncat_url = get_data("login.oncat", "oncat_url")
self.client_id = client_id or get_data("login.oncat", f"{key}_id")
if not self.client_id:
if client_id is not None:
self.client_id = client_id
elif key is not None:
self.client_id = get_data("login.oncat", f"{key}_id")
else:
raise ValueError(f"Invalid module {key}. No OnCat client Id is found or provided for this application.")

# use the partial client id to generate the filename
Expand Down Expand Up @@ -252,8 +255,6 @@ def update_connection_status(self: QGroupBox) -> None:
self.status_label.setText("ONCat: Disconnected")
self.status_label.setStyleSheet("color: red")

# self.connection_updated.emit(self.is_connected)

@property
def is_connected(self: QGroupBox) -> bool:
"""
Expand Down

0 comments on commit b2111ae

Please sign in to comment.