-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Cache team_size on Team model. #9491
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
Cache team_size on Team model. #9491
Conversation
lms/djangoapps/teams/models.py
Outdated
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.
@dan-f How will this field get populated for teams with existing memberships?
9ab9d37 to
edb9cab
Compare
|
Note that this will need a rebase-- my new PR is https://github.com/edx/edx-platform/pull/9503. And migration number 5 changed, so you will likely need to back up and redo migrations. |
ea04ef7 to
8404b2c
Compare
|
@cahrens I've removed the |
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.
How can we be sure that memberships will never be created in this way (this would not update the count, correct)?
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.
This way should update the count, I believe, because the count gets updated on the save of the team membership.
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.
Correct. I changed these lines to call add_user just because it makes sense to test membership creation in the way that the actual application code does it.
|
Nice work, @peter-fogg. I just have that one question (wondering if we should handle the addition in the create method of the membership itself). Otherwise 👍, and this is certainly in good enough shape to test with tomorrow. Please let the devops person who deploys the Ami to the load testing environment know that migrations need to be done. |
866b944 to
56846a2
Compare
|
@cahrens I had originally thought that we couldn't prevent someone from creating a membership with |
|
@dianakhuang Can you give a second review if you get a chance? |
lms/djangoapps/teams/models.py
Outdated
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.
Nit: This is an odd change, just because it doesn't really do anything differently?
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.
Ah, I'd been experimenting with some things and forgot to change that back. I'll fix it up.
|
Looks good to me. 👍 |
|
@peter-fogg Since there is no rush with trying to load test today, I'll wait until this PR merges to my branch before rebasing on master. |
TNL-3112 TNL-3154
56846a2 to
9e98a32
Compare
|
The only failing JS tests are the known flaky discussions tests, so I'll go ahead and merge this. |
@dan-f WIP PR.