-
Notifications
You must be signed in to change notification settings - Fork 539
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
Read Promoted Group Information Via Models #23082
base: master
Are you sure you want to change the base?
Read Promoted Group Information Via Models #23082
Conversation
ef58b87
to
d3fe342
Compare
with self.assertNumQueries(0): | ||
result = self.serializer.to_representation(obj) | ||
return result | ||
return self.serializer.to_representation(obj) |
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 know this is just a draft & not finished yet, but FYI, the search & autocomplete APIs handle a lot of our traffic and should never execute any database queries. We shouldn't ship a change that would regress this assertNumQueries(0)
assertion and the one below, they are important to keep.
with self.assertNumQueries(0): | ||
response = self.client.get(url, data, **headers) | ||
response = self.client.get(url, data, **headers) |
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.
As mentioned above, search should never execute database queries.
5f12b66
to
36ded4b
Compare
d497061
to
4928d11
Compare
Fixes: mozilla/addons#15350
Description
Reads promoted group information via models.
Context
Testing
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.