-
Notifications
You must be signed in to change notification settings - Fork 0
MPT-16304 Ensure correct model is used in services #157
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ async def refresh_module( | |
| context["accounts.module.id"] = first_module.id | ||
| context.set_resource("accounts.module", first_module) | ||
| return first_module | ||
| logger.warning("First module is not a Module instance.") | ||
| logger.warning("First module is not a Module instance.") # type: ignore[unreachable] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Be careful with this kind of errors, we shouldn't ignore it since it mens the code after this point will never run. Did you check that the typing is correct? did you try using cast method? I'd be great to improve a bit this logic using guard clauses or early returns, that way we avoid the spaguetti code and it's simpler to read and understand Something like -> |
||
| return None | ||
| logger.warning("Module 'Access Management' not found.") | ||
| return None | ||
|
|
||
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.
same comment -> https://github.com/softwareone-platform/mpt-api-python-client/pull/157/files#r2606300767