Skip to content

Commit 067bb4c

Browse files
committed
Updates to the API
1 parent d14115a commit 067bb4c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

readthedocs/core/static/core/js/readthedocs-client.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readthedocs/proxito/views/hosting.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,18 @@ def get(self, request):
2828
build = version.builds.last()
2929

3030
# TODO: define how it will be the exact JSON object returned here
31+
# NOTE: we could use the APIv3 serializers for some of these objects if we want to keep consistency.
32+
# However, those may require some extra db calls that we probably want to avoid.
3133
data = {
34+
"comment": (
35+
"THIS RESPONSE IS IN ALPHA FOR TEST PURPOSES ONLY"
36+
" AND IT'S GOING TO CHANGE COMPLETELY -- DO NOT USE IT!"
37+
),
3238
"project": {
3339
"slug": project.slug,
3440
"language": project.language,
3541
"repository_url": project.repo,
42+
"programming_language": project.programming_language,
3643
},
3744
"version": {
3845
"slug": version.slug,
@@ -44,7 +51,15 @@ def get(self, request):
4451
"domains": {
4552
"dashboard": settings.PRODUCTION_DOMAIN,
4653
},
54+
"readthedocs": {
55+
"analytics": {
56+
"code": settings.GLOBAL_ANALYTICS_CODE,
57+
},
58+
},
4759
"features": {
60+
"analytics": {
61+
"code": project.analytics_code,
62+
},
4863
"external_version_warning": {
4964
"enabled": True,
5065
"query_selector": "[role=main]",
@@ -66,7 +81,7 @@ def get(self, request):
6681
"slug": version.slug,
6782
"url": f"/{project.language}/{version.slug}/",
6883
}
69-
for version in project.versions.filter(active=True)
84+
for version in project.versions.filter(active=True).only("slug")
7085
],
7186
"downloads": [],
7287
# TODO: get this values properly

0 commit comments

Comments
 (0)