-
Notifications
You must be signed in to change notification settings - Fork 15
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
Raise exception when admin group name is not found #2196
Raise exception when admin group name is not found #2196
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
Returning |
Also used in A good solution could be adding a method like def ensure_id_from_groupname(name):
if (id := get_id_from_groupname(name)):
return id
else:
raise Exception |
This feels weird to me. We have a function called It feels like we should have a function that checks if the group exists, and then one that returns the group id (but is only used when we know the group exists). The slight problem with that is the way to check if the group exists is to try to retrieve the whole list of groups and search through it, which you then would have to do multiple times instead of once. |
This is the internal API so I wouldn't worry too much about names. You could change how the current Making two API calls when you only need one feels wasteful. |
Agree about the multiple API calls, which would be easy enough to stop by instead passing the list of groups to the functions from a separate call to |
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.
LGTM 👍
✅ Checklist
Enable foobar integration
rather than515 foobar
).develop
.🚦 Depends on
Raises an exception when the admin group name is specified incorrectly in the context.
🌂 Related issues
Closes #2187
🔬 Tests
Tested locally