Fix more n plus 1 queries - #1638
Conversation
✅ Deploy Preview for pydis-static ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
30c1a47 to
23f75f9
Compare
jchristgit
left a comment
There was a problem hiding this comment.
The select related change in apps/staff/views.py looks good to me.
The cache functionality does not seem like a good idea to me, because the invalidation isn't bulletproof. If multiple HTTP workers cache the roles, and one of them creates or deletes a new role, then only that HTTP worker will have its cache cleared, the rest will keep running around with a stale cache.
The filter list test also seems unrelated. I do not mind, but why was this added?
23f75f9 to
dfd232d
Compare
jc, thank you for the thorough review. I have dropped the role cache, as it breaks the bullet proof nature of oiur site deployment. I am sorry. I have also moved the filter list test to the first commit, since it's related to the code change in there, to retain 100% code coverage. |
jchristgit
left a comment
There was a problem hiding this comment.
LGTM, but note the queryset probably won't do anything on POST, right?
No description provided.