-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client id parameter #4
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #4 +/- ##
==========================================
+ Coverage 93.52% 93.75% +0.22%
==========================================
Files 3 3
Lines 139 144 +5
==========================================
+ Hits 130 135 +5
Misses 9 9 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/pyoncatqt/login.py
Outdated
@@ -215,11 +221,15 @@ def __init__(self: QGroupBox, key: str = None, parent: QWidget = None, **kwargs: | |||
# OnCat agent | |||
|
|||
self.oncat_url = get_data("login.oncat", "oncat_url") | |||
self.client_id = get_data("login.oncat", f"{key}_id") | |||
self.client_id = client_id or get_data("login.oncat", f"{key}_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small problem here. If neither is defined then the second half is get_data("login.oncat", "None_id")
which gives the right behavior but seems a little dodgy. It may be better to expand this out.
self.client_id = client_id or get_data("login.oncat", f"{key}_id") | |
if (client_id is not None): | |
self.client_id = client_id | |
else if (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.") |
I've not seen this syntax before. Thanks for the pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is another way to write the above in fewer lines. I'll update the code, if it creates issues. I added it, because it looked cleaner to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Short description of the changes:
Client id parameter as an optional parameter added for ONCatLogin.
Long description of the changes:
In detail it includes:
Check list for the pull request
Check list for the reviewer
Manual test for the reviewer
References
ClientId parameter able to be passed from the client application