Skip to content

Commit

Permalink
Projects: remove old/non-used fields (#11124)
Browse files Browse the repository at this point in the history
* Projects: remove old/non-used fields

Follow safe migrations instructions from
https://dev.readthedocs.io/en/latest/migrations.html to remove these fields.

* Lint

* Keep `Project.documentation_type` to avoid breaking changes

* Remove fields from fixture

* Remove more leftovers

* Lint

* Rename migrations

* Fix tests
  • Loading branch information
humitos committed Feb 27, 2024
1 parent 48203f2 commit 98e33f4
Show file tree
Hide file tree
Showing 13 changed files with 1,032 additions and 1,030 deletions.
5 changes: 0 additions & 5 deletions readthedocs/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,14 @@ def get_skip(self, obj):

class Meta(ProjectSerializer.Meta):
fields = ProjectSerializer.Meta.fields + (
"enable_epub_build",
"enable_pdf_build",
"conf_py_file",
"analytics_code",
"analytics_disabled",
"cdn_enabled",
"container_image",
"container_mem_limit",
"container_time_limit",
"install_project",
"skip",
"requirements_file",
"python_interpreter",
"features",
"has_valid_clone",
"has_valid_webhook",
Expand Down
10 changes: 0 additions & 10 deletions readthedocs/doc_builder/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,3 @@ def load_yaml_config(version, readthedocs_yaml_path=None):
readthedocs_yaml_path=readthedocs_yaml_path,
)
return config


def get_default_formats(project):
"""Get a list of the default formats for ``project``."""
formats = ["htmlzip"]
if project.enable_epub_build:
formats += ["epub"]
if project.enable_pdf_build:
formats += ["pdf"]
return formats
102 changes: 0 additions & 102 deletions readthedocs/projects/fixtures/test_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -83,14 +77,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -135,14 +123,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -187,14 +169,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -239,14 +215,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -291,14 +261,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -343,14 +307,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -395,14 +353,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -447,14 +399,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -499,14 +445,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -551,14 +491,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -603,14 +537,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -655,14 +583,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -707,14 +629,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -757,14 +673,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -807,14 +717,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down Expand Up @@ -857,14 +761,8 @@
"ad_free": false,
"is_spam": null,
"show_version_warning": false,
"enable_epub_build": true,
"enable_pdf_build": true,
"path": "",
"conf_py_file": "",
"featured": false,
"skip": false,
"install_project": false,
"python_interpreter": "python3",
"privacy_level": "public",
"language": "en",
"programming_language": "words",
Expand Down

0 comments on commit 98e33f4

Please sign in to comment.