-
Notifications
You must be signed in to change notification settings - Fork 1
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
Institutions LEI Bug #49
Conversation
Added a check for when no institutions are present. Added corresponding test.
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)src/entities/repos/institutions_repo.py
|
src/routers/institutions.py
Outdated
@@ -53,6 +53,8 @@ async def create_institution( | |||
async def get_associated_institutions(request: Request): | |||
user: AuthenticatedUser = request.user | |||
email_domain = get_email_domain(user.email) | |||
if not user.institutions: | |||
return [] | |||
associated_institutions = await repo.get_institutions(request.state.db_session, user.institutions) |
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.
let's also add the safe guard in the repo, so empty list of leis doesn't return everything
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.
The search by list of leis was added functionality to this endpoint. It would send all institutions back if nothing was specified (domain, pg #, count). For clarification, we want to remove this feature to be lei specific search?
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.
no, this stays as is, but the repo should have a safe guard as well; right now the repo treats both None
and empty list as the same, which shouldn't be the case.
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.
second thought, just have the logic in the repo is good enough, so the router doesn't need to have this check.
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
Closes #46