Cache team_size on Team model. - #9491
Conversation
There was a problem hiding this comment.
@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.
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.
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.
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? |
There was a problem hiding this comment.
Nit: This is an odd change, just because it doesn't really do anything differently?
There was a problem hiding this comment.
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.