Skip to content

Commit d7e64f4

Browse files
authored
Merge branch 'master' into remove-highlight-url-params
2 parents 6de6b33 + 01ef334 commit d7e64f4

File tree

26 files changed

+725
-200
lines changed

26 files changed

+725
-200
lines changed

CHANGELOG.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
Version 3.7.4
2+
-------------
3+
4+
:Date: September 05, 2019
5+
6+
* `@ericholscher <http://github.com/ericholscher>`__: Remove paid support callout (`#6140 <https://github.com/readthedocs/readthedocs.org/pull/6140>`__)
7+
* `@ericholscher <http://github.com/ericholscher>`__: Fix IntegrationAdmin with raw_id_fields for Projects (`#6136 <https://github.com/readthedocs/readthedocs.org/pull/6136>`__)
8+
* `@ericholscher <http://github.com/ericholscher>`__: Fix link to html_extra_path (`#6135 <https://github.com/readthedocs/readthedocs.org/pull/6135>`__)
9+
* `@stsewd <http://github.com/stsewd>`__: Move out authorization from FooterHTML view (`#6133 <https://github.com/readthedocs/readthedocs.org/pull/6133>`__)
10+
* `@agjohnson <http://github.com/agjohnson>`__: Add setting for always cleaning the build post-build (`#6132 <https://github.com/readthedocs/readthedocs.org/pull/6132>`__)
11+
* `@pyup-bot <http://github.com/pyup-bot>`__: pyup: Scheduled weekly dependency update for week 35 (`#6129 <https://github.com/readthedocs/readthedocs.org/pull/6129>`__)
12+
* `@stsewd <http://github.com/stsewd>`__: Refactor footer_html view to class (`#6125 <https://github.com/readthedocs/readthedocs.org/pull/6125>`__)
13+
* `@ericholscher <http://github.com/ericholscher>`__: Use raw_id_fields in the TokenAdmin (`#6116 <https://github.com/readthedocs/readthedocs.org/pull/6116>`__)
14+
* `@davidfischer <http://github.com/davidfischer>`__: Fixed footer ads supported on all themes (`#6115 <https://github.com/readthedocs/readthedocs.org/pull/6115>`__)
15+
* `@stsewd <http://github.com/stsewd>`__: Don't log BuildEnvironmentWarning as error (`#6112 <https://github.com/readthedocs/readthedocs.org/pull/6112>`__)
16+
* `@pllim <http://github.com/pllim>`__: Use the force when fetching with Git (`#6109 <https://github.com/readthedocs/readthedocs.org/pull/6109>`__)
17+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Record search queries smartly (`#6088 <https://github.com/readthedocs/readthedocs.org/pull/6088>`__)
18+
* `@stsewd <http://github.com/stsewd>`__: Add move method to automation rule (`#5998 <https://github.com/readthedocs/readthedocs.org/pull/5998>`__)
19+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Index more domain data into elasticsearch (`#5979 <https://github.com/readthedocs/readthedocs.org/pull/5979>`__)
20+
121
Version 3.7.3
222
-------------
323

docs/custom_installs/index.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ It has those features and more!
1212

1313
.. warning::
1414
These documents are maintained by the community, and might not be up to date.
15-
Read the Docs developers do not support custom installs of our software
16-
in our public issue tracker. For additional support of a custom installation,
17-
please see our `paid support plans <https://readthedocs.com/services/#open-source-support>`_.
15+
Read the Docs developers do not support custom installs of our software,
16+
as mentioned in our :doc:`/open-source-philosophy`.
1817

1918
.. toctree::
2019
:maxdepth: 2

docs/faq.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ To accomplish this, you can add a ``robots.txt`` file to your documentation's ro
257257

258258

259259
Minimal example of ``robots.txt``
260-
+++++++++++++++++++++++++++++++++
260+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
261261

262262
::
263263

@@ -270,22 +270,28 @@ Minimal example of ``robots.txt``
270270
See `Google's docs`_ for its full syntax.
271271

272272
This file has to be served as is under ``/robots.txt``.
273-
Depending if you are using Sphinx or MkDocs, you will need a different configuration for this.
274273

274+
Setup
275+
~~~~~
275276

276-
Sphinx
277-
~~~~~~
277+
The ``robots.txt`` file will be served from the **default version** of your Project.
278+
This is because the ``robots.txt`` file is served at the top-level of your domain,
279+
so we must choose a version to find the file in.
280+
The **default version** is the best place to look for it.
281+
282+
Sphinx and Mkdocs both have different ways of outputting static files in the build:
278283

279-
Sphinx uses `html_extra`_ option to add static files to the output.
280-
You need to create a ``robots.txt`` file and put it under the path defined in ``html_extra``.
284+
Sphinx
285+
++++++
281286

287+
Sphinx uses `html_extra_path`_ option to add static files to the output.
288+
You need to create a ``robots.txt`` file and put it under the path defined in ``html_extra_path``.
282289

283290
MkDocs
284-
~~~~~~
291+
++++++
285292

286293
MkDocs needs the ``robots.txt`` to be at the directory defined at `docs_dir`_ config.
287294

288-
289295
.. _Google's docs: https://support.google.com/webmasters/answer/6062608
290-
.. _html_extra: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path
296+
.. _html_extra_path: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path
291297
.. _docs_dir: https://www.mkdocs.org/user-guide/configuration/#docs_dir

docs/gsoc.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,6 @@ This could include:
9494
* Taking a swagger YAML file and generating HTML properly with Sphinx
9595
* Integration with our existing API to generate Swagger output
9696

97-
Autobuild docs for Pull Requests
98-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99-
100-
It would be great to automatically build docs for Pull Requests in GitHub repos that our users have.
101-
Currently we don't support this,
102-
and it's one of our most requested features.
103-
104-
This would include:
105-
106-
* Modeling Pull Requests as a type of version alongside Tags and Branches
107-
* Modifying how we upload HTML docs to store them in a place like S3 for long term storage
108-
* Build integration with GitHub to send the status notifications when a PR is building and complete
109-
110-
More info here:
111-
112-
* https://github.com/readthedocs/readthedocs.org/issues/1340
113-
* https://github.com/readthedocs/readthedocs.org/issues/2465
114-
115-
11697
Build a new Sphinx theme
11798
~~~~~~~~~~~~~~~~~~~~~~~~
11899

readthedocs/api/v2/permissions.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from rest_framework import permissions
44

5+
from readthedocs.builds.models import Version
56
from readthedocs.core.permissions import AdminPermission
67

78

@@ -83,3 +84,32 @@ def has_object_permission(self, request, view, obj):
8384
request.method in permissions.SAFE_METHODS or
8485
(request.user and request.user.is_staff)
8586
)
87+
88+
89+
class IsAuthorizedToViewVersion(permissions.BasePermission):
90+
91+
"""
92+
Checks if the user from the request has permissions to see the version.
93+
94+
This permission class used in the FooterHTML view.
95+
96+
.. note::
97+
98+
Views using this permissions should implement the
99+
`_get_version` and `_get_project` methods.
100+
"""
101+
102+
def has_permission(self, request, view):
103+
project = view._get_project()
104+
version = view._get_version()
105+
has_access = (
106+
Version.objects
107+
.public(
108+
user=request.user,
109+
project=project,
110+
only_active=False,
111+
)
112+
.filter(pk=version.pk)
113+
.exists()
114+
)
115+
return has_access

readthedocs/api/v2/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
function_urls = [
5858
url(r'docurl/', core_views.docurl, name='docurl'),
59-
url(r'footer_html/', footer_views.footer_html, name='footer_html'),
59+
url(r'footer_html/', footer_views.FooterHTML.as_view(), name='footer_html'),
6060
]
6161

6262
task_urls = [

0 commit comments

Comments
 (0)