Skip to content

Commit

Permalink
Remove allow_comments code
Browse files Browse the repository at this point in the history
  • Loading branch information
stsewd committed Mar 15, 2018
1 parent a3feab7 commit 6794a6e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
10 changes: 2 additions & 8 deletions readthedocs/doc_builder/backends/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,15 @@ class HtmlBuilder(BaseSphinx):

def __init__(self, *args, **kwargs):
super(HtmlBuilder, self).__init__(*args, **kwargs)
if self.project.allow_comments:
self.sphinx_builder = 'readthedocs-comments'
else:
self.sphinx_builder = 'readthedocs'
self.sphinx_builder = 'readthedocs'


class HtmlDirBuilder(HtmlBuilder):
type = 'sphinx_htmldir'

def __init__(self, *args, **kwargs):
super(HtmlDirBuilder, self).__init__(*args, **kwargs)
if self.project.allow_comments:
self.sphinx_builder = 'readthedocsdirhtml-comments'
else:
self.sphinx_builder = 'readthedocsdirhtml'
self.sphinx_builder = 'readthedocsdirhtml'


class SingleHtmlBuilder(HtmlBuilder):
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/projects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class ProjectAdmin(GuardedModelAdmin):
"""Project model admin view."""

prepopulated_fields = {'slug': ('name',)}
list_display = ('name', 'slug', 'repo', 'repo_type', 'allow_comments', 'featured', 'theme')
list_filter = ('repo_type', 'allow_comments', 'featured', 'privacy_level',
list_display = ('name', 'slug', 'repo', 'repo_type', 'featured', 'theme')
list_filter = ('repo_type', 'featured', 'privacy_level',
'documentation_type', 'programming_language',
ProjectOwnerBannedFilter)
list_editable = ('featured',)
Expand Down
26 changes: 0 additions & 26 deletions readthedocs/rtd_tests/tests/test_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,32 +129,6 @@ def test_build_respects_yaml(self):
# PDF however was disabled and therefore not built.
self.assertFalse(self.mocks.pdf_build.called)

def test_builder_comments(self):
'''Normal build with comments'''
project = get(Project,
documentation_type='sphinx',
allow_comments=True,
versions=[fixture()])
version = project.versions.all()[0]
build_env = LocalBuildEnvironment(version=version, project=project, build={})
python_env = Virtualenv(version=version, build_env=build_env)
builder_class = get_builder_class(project.documentation_type)
builder = builder_class(build_env, python_env)
self.assertEqual(builder.sphinx_builder, 'readthedocs-comments')

def test_builder_no_comments(self):
'''Test builder without comments'''
project = get(Project,
documentation_type='sphinx',
allow_comments=False,
versions=[fixture()])
version = project.versions.all()[0]
build_env = LocalBuildEnvironment(version=version, project=project, build={})
python_env = Virtualenv(version=version, build_env=build_env)
builder_class = get_builder_class(project.documentation_type)
builder = builder_class(build_env, python_env)
self.assertEqual(builder.sphinx_builder, 'readthedocs')

def test_build_pdf_latex_failures(self):
'''Build failure if latex fails'''

Expand Down

0 comments on commit 6794a6e

Please sign in to comment.