Skip to content

Commit ed73218

Browse files
committed
Merge branch 'master' into remove-projects-page
2 parents 93b3dc1 + 2e76781 commit ed73218

File tree

11 files changed

+1066
-392
lines changed

11 files changed

+1066
-392
lines changed

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ of Read the Docs and the larger software documentation ecosystem.
163163
* **Policies & Process**:
164164
:doc:`security` |
165165
:doc:`Privacy policy <privacy-policy>` |
166+
:doc:`Terms of service <terms-of-service>` |
166167
:doc:`DMCA takedown policy <dmca/index>` |
167168
:doc:`Policy for abandoned projects <abandoned-projects>` |
168169
:doc:`Release notes & changelog <changelog>`
@@ -195,6 +196,7 @@ of Read the Docs and the larger software documentation ecosystem.
195196

196197
security
197198
privacy-policy
199+
terms-of-service
198200
dmca/index
199201
abandoned-projects
200202
changelog

docs/privacy-policy.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Privacy Policy
55
==============
66

7-
Effective date: **August 1, 2019**
7+
Effective date: **September 30, 2019**
88

99
Welcome to Read the Docs.
1010
At Read the Docs, we believe in protecting the privacy of our
@@ -30,22 +30,24 @@ Our services
3030
Read the Docs is made up of:
3131

3232
readthedocs.org ("Read the Docs Community")
33-
This is a website aimed at documentation authors writing and building
34-
software documentation. This Privacy Policy applies to this site
35-
in full without reservation.
33+
This is a website aimed at documentation authors and project maintainers
34+
writing and distributing technical documentation.
35+
This Privacy Policy applies to this site in full without reservation.
3636

3737
readthedocs.com ("Read the Docs for Business")
3838
This website is a commercial hosted offering for hosting private
3939
documentation for corporate clients.
40-
It is governed by this privacy policy but also separate
41-
`terms <https://readthedocs.com/terms/>`_.
40+
This Privacy Policy applies to this site in full without reservation.
4241

4342
readthedocs.io, readthedocs-hosted.com, and other domains ("Documentation Sites")
44-
These websites are where Read the Docs hosts documentation on
45-
behalf of documentation authors. A best effort is made to apply
43+
These websites are where Read the Docs hosts documentation (":ref:`User-Generated Content <terms-of-service:User-Generated Content>`")
44+
on behalf of documentation authors.
45+
A best effort is made to apply
4646
this Privacy Policy to these sites but the documentation
4747
may contain content and files created by documentation authors.
4848

49+
All use of Read the Docs is subject to this Privacy Policy, together with our :doc:`Terms of service <terms-of-service>`.
50+
4951

5052
What information Read the Docs collects and why
5153
-----------------------------------------------
@@ -115,6 +117,9 @@ anyone (including us) may view their contents.
115117
If you have included private or sensitive information in your Documentation Site,
116118
such as email addresses, that information may be indexed by search engines or used by third parties.
117119

120+
Read the Docs for Business may host :ref:`private projects <terms-of-service:Private projects>` which we treat as confidential
121+
and we only access them for support reasons, with your consent, or if required to for security reasons
122+
118123
If you're a **child under the age of 13**, you may not have an account on Read the Docs.
119124
Read the Docs does not knowingly collect information from or direct any of our content specifically to children under 13.
120125
If we learn or have reason to suspect that you are a user who is under the age of 13, we will unfortunately have to close your account.

docs/terms-of-service.rst

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

readthedocs/api/v2/urls.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
BuildCommandViewSet,
1818
BuildViewSet,
1919
DomainViewSet,
20-
NotificationViewSet,
2120
ProjectViewSet,
2221
RemoteOrganizationViewSet,
2322
RemoteRepositoryViewSet,
@@ -31,7 +30,6 @@
3130
router.register(r'command', BuildCommandViewSet, basename='buildcommandresult')
3231
router.register(r'version', VersionViewSet, basename='version')
3332
router.register(r'project', ProjectViewSet, basename='project')
34-
router.register(r'notification', NotificationViewSet, basename='emailhook')
3533
router.register(r'domain', DomainViewSet, basename='domain')
3634
router.register(r'sphinx_domain', SphinxDomainAPIView, basename='sphinxdomain')
3735
router.register(

readthedocs/api/v2/views/model_views.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,6 @@ class BuildCommandViewSet(UserSelectViewSet):
292292
model = BuildCommandResult
293293

294294

295-
class NotificationViewSet(viewsets.ReadOnlyModelViewSet):
296-
permission_classes = (permissions.IsAuthenticated, RelatedProjectIsOwner)
297-
renderer_classes = (JSONRenderer,)
298-
model = EmailHook
299-
300-
def get_queryset(self):
301-
return self.model.objects.api(self.request.user)
302-
303-
304295
class DomainViewSet(UserSelectViewSet):
305296
permission_classes = [APIRestrictedPermission]
306297
renderer_classes = (JSONRenderer,)

readthedocs/api/v3/serializers.py

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ class BuildSerializer(FlexFieldsModelSerializer):
115115
state = BuildStateSerializer(source='*')
116116
_links = BuildLinksSerializer(source='*')
117117

118-
expandable_fields = dict(
119-
config=(
120-
BuildConfigSerializer,
121-
dict(
122-
source='config',
123-
),
124-
),
125-
)
126-
127118
class Meta:
128119
model = Build
129120
fields = [
@@ -140,6 +131,10 @@ class Meta:
140131
'_links',
141132
]
142133

134+
expandable_fields = {
135+
'config': (BuildConfigSerializer, {'source': 'config'})
136+
}
137+
143138
def get_finished(self, obj):
144139
if obj.date and obj.length:
145140
return obj.date + datetime.timedelta(seconds=obj.length)
@@ -215,15 +210,6 @@ class VersionSerializer(FlexFieldsModelSerializer):
215210
urls = VersionURLsSerializer(source='*')
216211
_links = VersionLinksSerializer(source='*')
217212

218-
expandable_fields = dict(
219-
last_build=(
220-
BuildSerializer,
221-
dict(
222-
source='last_build',
223-
),
224-
),
225-
)
226-
227213
class Meta:
228214
model = Version
229215
fields = [
@@ -241,6 +227,12 @@ class Meta:
241227
'_links',
242228
]
243229

230+
expandable_fields = {
231+
'last_build': (
232+
BuildSerializer, {'source': 'last_build'}
233+
)
234+
}
235+
244236
def get_downloads(self, obj):
245237
downloads = obj.get_downloads()
246238
data = {}
@@ -448,18 +440,6 @@ class ProjectSerializer(FlexFieldsModelSerializer):
448440
created = serializers.DateTimeField(source='pub_date')
449441
modified = serializers.DateTimeField(source='modified_date')
450442

451-
expandable_fields = dict(
452-
active_versions=(
453-
VersionSerializer,
454-
dict(
455-
# NOTE: this has to be a Model method, can't be a
456-
# ``SerializerMethodField`` as far as I know
457-
source='active_versions',
458-
many=True,
459-
),
460-
),
461-
)
462-
463443
class Meta:
464444
model = Project
465445
fields = [
@@ -489,6 +469,18 @@ class Meta:
489469
'_links',
490470
]
491471

472+
expandable_fields = {
473+
'active_versions': (
474+
VersionSerializer,
475+
{
476+
# NOTE: this has to be a Model method, can't be a
477+
# ``SerializerMethodField`` as far as I know
478+
'source': 'active_versions',
479+
'many': True,
480+
}
481+
)
482+
}
483+
492484
def get_homepage(self, obj):
493485
# Overridden only to return ``None`` when the project_url is ``''``
494486
return obj.project_url or None

conftest.py renamed to readthedocs/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# -*- coding: utf-8 -*-
21
import pytest
3-
from django.conf import settings
42
from rest_framework.test import APIClient
53

4+
65
try:
76
# TODO: this file is read/executed even when called from ``readthedocsinc``,
87
# so it's overriding the options that we are defining in the ``conftest.py``

readthedocs/projects/urls/private.py

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,20 @@
2727
ProjectAdvertisingUpdate,
2828
ProjectDashboard,
2929
ProjectDelete,
30+
ProjectNotications,
31+
ProjectNoticationsDelete,
32+
ProjectRedirects,
33+
ProjectRedirectsDelete,
34+
ProjectTranslationsDelete,
35+
ProjectTranslationsListAndCreate,
3036
ProjectUpdate,
37+
ProjectUsersCreateList,
38+
ProjectUsersDelete,
39+
ProjectVersionDeleteHTML,
40+
ProjectVersionDetail,
41+
SearchAnalytics,
3142
)
3243

33-
3444
urlpatterns = [
3545
url(r'^$', ProjectDashboard.as_view(), name='projects_dashboard'),
3646
url(
@@ -62,57 +72,67 @@
6272
),
6373
url(
6474
r'^(?P<project_slug>[-\w]+)/version/(?P<version_slug>[^/]+)/delete_html/$',
65-
private.project_version_delete_html, name='project_version_delete_html',
75+
ProjectVersionDeleteHTML.as_view(),
76+
name='project_version_delete_html',
6677
),
6778
url(
6879
r'^(?P<project_slug>[-\w]+)/version/(?P<version_slug>[^/]+)/$',
69-
private.project_version_detail, name='project_version_detail',
80+
ProjectVersionDetail.as_view(),
81+
name='project_version_detail',
7082
),
7183
url(
7284
r'^(?P<project_slug>[-\w]+)/delete/$',
7385
ProjectDelete.as_view(),
7486
name='projects_delete',
7587
),
7688
url(
77-
r'^(?P<project_slug>[-\w]+)/users/$', private.project_users,
89+
r'^(?P<project_slug>[-\w]+)/users/$',
90+
ProjectUsersCreateList.as_view(),
7891
name='projects_users',
7992
),
8093
url(
8194
r'^(?P<project_slug>[-\w]+)/users/delete/$',
82-
private.project_users_delete, name='projects_users_delete',
95+
ProjectUsersDelete.as_view(),
96+
name='projects_users_delete',
8397
),
8498
url(
8599
r'^(?P<project_slug>[-\w]+)/notifications/$',
86-
private.project_notifications, name='projects_notifications',
100+
ProjectNotications.as_view(),
101+
name='projects_notifications',
87102
),
88103
url(
89104
r'^(?P<project_slug>[-\w]+)/notifications/delete/$',
90-
private.project_notifications_delete, name='projects_notification_delete',
105+
ProjectNoticationsDelete.as_view(),
106+
name='projects_notification_delete',
91107
),
92108
url(
93109
r'^(?P<project_slug>[-\w]+)/translations/$',
94-
private.project_translations, name='projects_translations',
110+
ProjectTranslationsListAndCreate.as_view(),
111+
name='projects_translations',
95112
),
96113
url(
97114
r'^(?P<project_slug>[-\w]+)/translations/delete/(?P<child_slug>[-\w]+)/$', # noqa
98-
private.project_translations_delete,
115+
ProjectTranslationsDelete.as_view(),
99116
name='projects_translations_delete',
100117
),
101118
url(
102-
r'^(?P<project_slug>[-\w]+)/redirects/$', private.project_redirects,
119+
r'^(?P<project_slug>[-\w]+)/redirects/$',
120+
ProjectRedirects.as_view(),
103121
name='projects_redirects',
104122
),
105123
url(
106124
r'^(?P<project_slug>[-\w]+)/redirects/delete/$',
107-
private.project_redirects_delete, name='projects_redirects_delete',
125+
ProjectRedirectsDelete.as_view(),
126+
name='projects_redirects_delete',
108127
),
109128
url(
110129
r'^(?P<project_slug>[-\w]+)/advertising/$',
111130
ProjectAdvertisingUpdate.as_view(), name='projects_advertising',
112131
),
113132
url(
114133
r'^(?P<project_slug>[-\w]+)/search-analytics/$',
115-
private.search_analytics_view, name='projects_search_analytics',
134+
SearchAnalytics.as_view(),
135+
name='projects_search_analytics',
116136
),
117137
]
118138

0 commit comments

Comments
 (0)