-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Addons: small improvements and privacy considerations #11561
base: main
Are you sure you want to change the base?
Conversation
This is still missing tests, but those will be in .com, and this PR won't change much. So, marking it as ready for review. |
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 good to me. I just left a few suggestions and comments 👍🏼
def get( | ||
self, | ||
addons_version, | ||
project, | ||
request, |
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.
There is no need to receive the request
here and passing it to the other methods. We just need the user
; which is the only attribute we are using from the request
.
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.
A request object is needed for .com,see https://github.com/readthedocs/readthedocs-corporate/pull/1857.
project_translations = project_translations.order_by("language").select_related( | ||
"main_language_project" | ||
) |
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.
Why do we need the main_language_project
as select related here? Where is it used?
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.
It's used in the serializer, we are doing lots of n+1 queries there.
Some notes:
addons
key.Since to really run the whole code from permissions checks organizations are needed, I'll add tests on .com.
ref https://github.com/readthedocs/readthedocs-corporate/issues/1773