-
Notifications
You must be signed in to change notification settings - Fork 18
fix: improve collections models and api [FC-0059] #208
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
fix: improve collections models and api [FC-0059] #208
Conversation
|
Thanks for the pull request, @rpenido! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
db3b742 to
daecf9f
Compare
daecf9f to
ef09229
Compare
yusuf-musleh
left a comment
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.
👍 @rpenido Looks good to me, great work! Just had a question about the index, if you can kindly address it.
- I tested this: I read through the code and confirmed tests are passing
- I read through the code
-
I checked for accessibility issues - Includes documentation
| indexes = [ | ||
| models.Index(fields=["learning_package_id", "title"]), | ||
| ] |
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.
I just wanted to confirm, since the ForeignKey field defined is learning_package, should this index be learning_package instead of learning_package_id? I was looking at other places in the code where indexes are defined, and the ForeignKey fields are defined without the _id, so I just wanted to make sure if I am missing something.
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.
I think you are right @yusuf-musleh !
Fixed here: 9417609
|
Hi @pomegranited! Could you do a last review, merge and tag a new version if everything is good? |
yusuf-musleh
left a comment
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.
@rpenido I noticed a field was missing from the create_collection api as I was working on the REST endpoints, if you could take a look at it below.
| def create_collection( | ||
| learning_package_id: int, |
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.
| def create_collection( | |
| learning_package_id: int, | |
| def create_collection( | |
| learning_package_id: int, | |
| created_by: int | None, |
I realized the created_by value was missing from the params and in the .create below, would you mind adding them in this PR since I needed it when I was working on the REST endpoints.
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.
Good catch @yusuf-musleh!
Fixed here: a30e04a
| description=description, | ||
| ) |
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.
| description=description, | |
| ) | |
| description=description, | |
| created_by=created_by, | |
| ) |
Likewise we need to add the created_by here
9cdd1e7 to
89f4cea
Compare
89f4cea to
a30e04a
Compare
because we're passing an int ID. Also adds a test.
pomegranited
left a comment
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 great @rpenido ! I had a couple of nits, so just pushed them in to move this along. Will get this merged ASAP.
- I tested this by running the tests.
- I read through the code and ensured tests cover all of the Collections code.
-
I checked for accessibility issuesN/A - Includes documentation
- User-facing strings are extracted for translation
|
Thank you @pomegranited! |
|
@rpenido 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
This PR fixes some issues in the Collections model from #206 and adds some improvements to the implementation.
Testing Instructions
Private ref: FAL-3782