Skip to content
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

Add indelx.html filename to the external doc url #6051

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions readthedocs/builds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,11 @@ def get_absolute_url(self):
# TODO: We can integrate them into the resolver
# but this is much simpler to handle since we only link them a couple places for now
if self.type == EXTERNAL:
url = f'{settings.EXTERNAL_VERSION_URL}/html/' \
f'{self.project.slug}/{self.slug}/'
# Django's static file serving doesn't automatically append index.html
if settings.DEBUG:
url += 'index.html'
url = f'{settings.EXTERNAL_VERSION_URL}/html/' \
f'{self.project.slug}/{self.slug}/index.html'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be written like

url = (
    f'some string'
    f'another string'
)

That way we don't use \

return url

if not self.built and not self.uploaded:
return reverse(
'project_version_detail',
Expand Down