-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Set EXTERNAL_DOCS setting for OpenAPI spec #13430
Conversation
Make returning the home page of the documentation more consistent with existing code logic and with clearer intent, improving code readability.
Head branch was pushed to by a user without write access
The merge conflict has been resolved and the PR should be good to go now. |
weblate/api/spectacular.py
Outdated
@@ -9,6 +9,8 @@ | |||
|
|||
from django.utils.translation import gettext_lazy | |||
|
|||
from weblate.utils.docs import get_doc_url |
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.
Unfortunately, this won't work because get_doc_url
relies on settings and get_spectacular_settings
is called from settings. In the end, Django fails to load the settings and fails with weird errors like you can see in the test suite.
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 have changed it so that EXTERNAL_DOCS
uses a hardcoded URL to the home page of documentation. I don't know how to fix this issue properly in a timely manner, and don't want to delay release for your milestone...
The changes to get_doc_url
have also been reverted.
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.
Using lazy evaluation might work, but it depends on when this setting is actually used.
029918c
to
da753e6
Compare
da753e6
to
5c44349
Compare
for more information, see https://pre-commit.ci
This is followup for WeblateOrg#13430
Proposed changes
EXTERNAL_DOCS
setting for the OpenAPI document.Checklist
Other information
Relates to #12584