Skip to content

Commit 050c974

Browse files
committed
Move auto detection for doctype
1 parent 8b077e9 commit 050c974

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

readthedocs/projects/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,11 @@ def save(self, *args, **kwargs): # pylint: disable=arguments-differ
318318
self.slug = slugify(self.name)
319319
if self.slug == '':
320320
raise Exception(_('Model must have slug'))
321+
if self.documentation_type == 'auto':
322+
# This used to determine the type and automatically set the
323+
# documentation type to Sphinx for rST and Mkdocs for markdown.
324+
# It now just forces Sphinx, due to markdown support.
325+
self.documentation_type = 'sphinx'
321326
super(Project, self).save(*args, **kwargs)
322327
for owner in self.users.all():
323328
assign('view_project', owner, self)

readthedocs/projects/tasks.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,6 @@ def run_build(self, docker, record):
470470

471471
# Environment used for building code, usually with Docker
472472
with self.build_env:
473-
474-
if self.project.documentation_type == 'auto':
475-
self.update_documentation_type()
476-
477473
python_env_cls = Virtualenv
478474
if self.config.conda is not None:
479475
self._log('Using conda')
@@ -589,21 +585,6 @@ def set_valid_clone(self):
589585
self.project.has_valid_clone = True
590586
self.version.project.has_valid_clone = True
591587

592-
def update_documentation_type(self):
593-
"""
594-
Force Sphinx for 'auto' documentation type.
595-
596-
This used to determine the type and automatically set the documentation
597-
type to Sphinx for rST and Mkdocs for markdown. It now just forces
598-
Sphinx, due to markdown support.
599-
"""
600-
ret = 'sphinx'
601-
project_data = api_v2.project(self.project.pk).get()
602-
project_data['documentation_type'] = ret
603-
api_v2.project(self.project.pk).put(project_data)
604-
self.project.documentation_type = ret
605-
self.version.project.documentation_type = ret
606-
607588
def update_app_instances(self, html=False, localmedia=False, search=False,
608589
pdf=False, epub=False):
609590
"""

0 commit comments

Comments
 (0)