Skip to content

Fix extra origin in urls #5523

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

Merged
merged 10 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
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
12 changes: 7 additions & 5 deletions readthedocs/projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ def __init__(self, *args, **kwargs):
)

default_choice = (None, '-' * 9)
all_versions = self.instance.versions.values_list(
'identifier',
'verbose_name',
)
# commit_name is used as the id because it handles
# the special cases of LATEST and STABLE.
all_versions_choices = [
(v.commit_name, v.verbose_name)
for v in self.instance.versions.all()
]
self.fields['default_branch'].widget = forms.Select(
choices=[default_choice] + list(all_versions),
choices=[default_choice] + all_versions_choices,
)

active_versions = self.get_all_active_versions()
Expand Down
8 changes: 7 additions & 1 deletion readthedocs/rtd_tests/tests/test_project_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
)
from readthedocs.projects.exceptions import ProjectSpamError
from readthedocs.projects.forms import (
EmailHookForm,
EnvironmentVariableForm,
ProjectAdvancedForm,
ProjectBasicsForm,
ProjectExtraForm,
TranslationForm,
UpdateProjectForm,
WebHookForm,
EmailHookForm
)
from readthedocs.projects.models import EnvironmentVariable, Project

Expand Down Expand Up @@ -201,6 +201,7 @@ def setUp(self):
active=True,
privacy_level=PUBLIC,
identifier='public-1',
verbose_name='public-1',
)
get(
Version,
Expand All @@ -209,6 +210,7 @@ def setUp(self):
active=True,
privacy_level=PUBLIC,
identifier='public-2',
verbose_name='public-2',
)
get(
Version,
Expand All @@ -217,6 +219,7 @@ def setUp(self):
active=False,
privacy_level=PROTECTED,
identifier='public-3',
verbose_name='public-3',
)
get(
Version,
Expand All @@ -225,6 +228,7 @@ def setUp(self):
active=False,
privacy_level=PUBLIC,
identifier='public/4',
verbose_name='public/4',
)
get(
Version,
Expand All @@ -233,6 +237,7 @@ def setUp(self):
active=True,
privacy_level=PRIVATE,
identifier='private',
verbose_name='private',
)
get(
Version,
Expand All @@ -241,6 +246,7 @@ def setUp(self):
active=True,
privacy_level=PROTECTED,
identifier='protected',
verbose_name='protected',
)

def test_list_only_active_versions_on_default_version(self):
Expand Down