Skip to content

Commit 6ea4ec6

Browse files
authored
Remove embed API v2 code (#11945)
🗑️
1 parent 03f73a6 commit 6ea4ec6

File tree

12 files changed

+21
-1379
lines changed

12 files changed

+21
-1379
lines changed

readthedocs/api/mixins.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
import structlog
44
from django.http import Http404
5-
from django.shortcuts import get_object_or_404
65
from django.utils.functional import cached_property
76

87
from readthedocs.core.unresolver import UnresolverError, unresolve
98
from readthedocs.core.utils import get_cache_tag
10-
from readthedocs.projects.models import Project
119
from readthedocs.proxito.cache import add_cache_tags
1210

1311
log = structlog.get_logger(__name__)
@@ -77,11 +75,6 @@ class EmbedAPIMixin:
7775
to avoid hitting the database multiple times on the same request.
7876
"""
7977

80-
# This class is shared between EmbedAPI v2 and v3.
81-
# In v3, we only support the `url` parameter,
82-
# but in v2 we support `project` and `version` as well.
83-
support_url_parameter_only = False
84-
8578
@cached_property
8679
def unresolved_url(self):
8780
url = self.request.GET.get("url")
@@ -102,11 +95,7 @@ def _get_project(self):
10295
if self.unresolved_url:
10396
return self.unresolved_url.project
10497

105-
if self.support_url_parameter_only:
106-
raise Http404
107-
108-
project_slug = self.request.GET.get("project")
109-
return get_object_or_404(Project, slug=project_slug)
98+
raise Http404
11099

111100
@functools.lru_cache(maxsize=1)
112101
def _get_version(self):
@@ -116,9 +105,4 @@ def _get_version(self):
116105
if self.unresolved_url:
117106
return self.unresolved_url.version
118107

119-
if self.support_url_parameter_only:
120-
raise Http404
121-
122-
version_slug = self.request.GET.get("version", "latest")
123-
project = self._get_project()
124-
return get_object_or_404(project.versions.all(), slug=version_slug)
108+
raise Http404

readthedocs/embed/tests/data/sphinx/latest/index.html

Lines changed: 0 additions & 424 deletions
This file was deleted.

readthedocs/embed/tests/data/sphinx/latest/index.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

readthedocs/embed/tests/data/sphinx/latest/page-i-need-secrets-or-environment-variables-in-my-build.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

readthedocs/embed/tests/data/sphinx/latest/page-sub-title-one.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

readthedocs/embed/tests/data/sphinx/latest/page-subsub-title.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

readthedocs/embed/tests/data/sphinx/latest/page-title-one.html

Lines changed: 0 additions & 95 deletions
This file was deleted.

readthedocs/embed/tests/data/sphinx/latest/page.html

Lines changed: 0 additions & 103 deletions
This file was deleted.

readthedocs/embed/tests/data/sphinx/latest/page.json

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)