Skip to content

Commit a1bd6a4

Browse files
committed
Merge branch 'master' of github.com:rtfd/readthedocs.org into search-reapply
2 parents 95b23c2 + d2137df commit a1bd6a4

28 files changed

+606
-229
lines changed

.readthedocs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
formats: all
3+
sphinx:
4+
configuration: docs/conf.py
5+
python:
6+
requirements: requirements.txt

CHANGELOG.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
1+
Version 2.8.1
2+
-------------
3+
4+
:Date: November 06, 2018
5+
6+
* `@ericholscher <http://github.com/ericholscher>`__: Fix migration name on modified date migration (`#4867 <https://github.com/rtfd/readthedocs.org/pull/4867>`__)
7+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Change 'VerisionLockedTimeout' to 'VersionLockedError' in comment. (`#4859 <https://github.com/rtfd/readthedocs.org/pull/4859>`__)
8+
* `@stsewd <http://github.com/stsewd>`__: Fix rtd config file (`#4857 <https://github.com/rtfd/readthedocs.org/pull/4857>`__)
9+
* `@ericholscher <http://github.com/ericholscher>`__: Shorten project name to match slug length (`#4856 <https://github.com/rtfd/readthedocs.org/pull/4856>`__)
10+
* `@stsewd <http://github.com/stsewd>`__: Generic message for parser error of config file (`#4853 <https://github.com/rtfd/readthedocs.org/pull/4853>`__)
11+
* `@stsewd <http://github.com/stsewd>`__: Use $HOME as CWD for virtualenv creation (`#4852 <https://github.com/rtfd/readthedocs.org/pull/4852>`__)
12+
* `@stsewd <http://github.com/stsewd>`__: Hide "edit on" when the version is a tag (`#4851 <https://github.com/rtfd/readthedocs.org/pull/4851>`__)
13+
* `@ericholscher <http://github.com/ericholscher>`__: Add modified_date to ImportedFile. (`#4850 <https://github.com/rtfd/readthedocs.org/pull/4850>`__)
14+
* `@ericholscher <http://github.com/ericholscher>`__: Use raw_id_fields so that the Feature admin loads (`#4849 <https://github.com/rtfd/readthedocs.org/pull/4849>`__)
15+
* `@stsewd <http://github.com/stsewd>`__: Allow to change project's VCS (`#4845 <https://github.com/rtfd/readthedocs.org/pull/4845>`__)
16+
* `@benjaoming <http://github.com/benjaoming>`__: Version compare warning text (`#4842 <https://github.com/rtfd/readthedocs.org/pull/4842>`__)
17+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Make form for adopting project a choice field (`#4841 <https://github.com/rtfd/readthedocs.org/pull/4841>`__)
18+
* `@humitos <http://github.com/humitos>`__: Do not send notification on VersionLockedError (`#4839 <https://github.com/rtfd/readthedocs.org/pull/4839>`__)
19+
* `@stsewd <http://github.com/stsewd>`__: Start testing config v2 on our project (`#4838 <https://github.com/rtfd/readthedocs.org/pull/4838>`__)
20+
* `@ericholscher <http://github.com/ericholscher>`__: Add all migrations that are missing from model changes (`#4837 <https://github.com/rtfd/readthedocs.org/pull/4837>`__)
21+
* `@ericholscher <http://github.com/ericholscher>`__: Add docstring to DrfJsonSerializer so we know why it's there (`#4836 <https://github.com/rtfd/readthedocs.org/pull/4836>`__)
22+
* `@ericholscher <http://github.com/ericholscher>`__: Show the project's slug in the dashboard (`#4834 <https://github.com/rtfd/readthedocs.org/pull/4834>`__)
23+
* `@humitos <http://github.com/humitos>`__: Avoid infinite redirection (`#4833 <https://github.com/rtfd/readthedocs.org/pull/4833>`__)
24+
* `@ericholscher <http://github.com/ericholscher>`__: Allow filtering builds by commit. (`#4831 <https://github.com/rtfd/readthedocs.org/pull/4831>`__)
25+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Add 'Branding' under the 'Business Info' section and 'Guidelines' on 'Design Docs' (`#4830 <https://github.com/rtfd/readthedocs.org/pull/4830>`__)
26+
* `@davidfischer <http://github.com/davidfischer>`__: Migrate old passwords without "set_unusable_password" (`#4829 <https://github.com/rtfd/readthedocs.org/pull/4829>`__)
27+
* `@humitos <http://github.com/humitos>`__: Do not import the Celery worker when running the Django app (`#4824 <https://github.com/rtfd/readthedocs.org/pull/4824>`__)
28+
* `@damianz5 <http://github.com/damianz5>`__: Fix for jQuery in doc-embed call (`#4819 <https://github.com/rtfd/readthedocs.org/pull/4819>`__)
29+
* `@invinciblycool <http://github.com/invinciblycool>`__: Add MkDocsYAMLParseError (`#4814 <https://github.com/rtfd/readthedocs.org/pull/4814>`__)
30+
* `@stsewd <http://github.com/stsewd>`__: Delete untracked tags on fetch (`#4811 <https://github.com/rtfd/readthedocs.org/pull/4811>`__)
31+
* `@stsewd <http://github.com/stsewd>`__: Don't activate version on build (`#4810 <https://github.com/rtfd/readthedocs.org/pull/4810>`__)
32+
* `@humitos <http://github.com/humitos>`__: Feature flag to make `readthedocs` theme default on MkDocs docs (`#4802 <https://github.com/rtfd/readthedocs.org/pull/4802>`__)
33+
* `@ericholscher <http://github.com/ericholscher>`__: Allow use of `file://` urls in repos during development. (`#4801 <https://github.com/rtfd/readthedocs.org/pull/4801>`__)
34+
* `@ericholscher <http://github.com/ericholscher>`__: Release 2.7.2 (`#4796 <https://github.com/rtfd/readthedocs.org/pull/4796>`__)
35+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Raise 404 at SubdomainMiddleware if the project does not exist. (`#4795 <https://github.com/rtfd/readthedocs.org/pull/4795>`__)
36+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Add help_text in the form for adopting a project (`#4781 <https://github.com/rtfd/readthedocs.org/pull/4781>`__)
37+
* `@humitos <http://github.com/humitos>`__: Add VAT ID field for Gold User (`#4776 <https://github.com/rtfd/readthedocs.org/pull/4776>`__)
38+
* `@sriks123 <http://github.com/sriks123>`__: Remove logic around finding config file inside directories (`#4755 <https://github.com/rtfd/readthedocs.org/pull/4755>`__)
39+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Improve unexpected error message when build fails (`#4754 <https://github.com/rtfd/readthedocs.org/pull/4754>`__)
40+
* `@stsewd <http://github.com/stsewd>`__: Don't build latest on webhook if it is deactivated (`#4733 <https://github.com/rtfd/readthedocs.org/pull/4733>`__)
41+
* `@dojutsu-user <http://github.com/dojutsu-user>`__: Change the way of using login_required decorator (`#4723 <https://github.com/rtfd/readthedocs.org/pull/4723>`__)
42+
* `@invinciblycool <http://github.com/invinciblycool>`__: Remove unused views and their translations. (`#4632 <https://github.com/rtfd/readthedocs.org/pull/4632>`__)
43+
* `@invinciblycool <http://github.com/invinciblycool>`__: Redirect to build detail post manual build (`#4622 <https://github.com/rtfd/readthedocs.org/pull/4622>`__)
44+
* `@anubhavsinha98 <http://github.com/anubhavsinha98>`__: Issue #4551 Changed mock docks to use sphinx (`#4569 <https://github.com/rtfd/readthedocs.org/pull/4569>`__)
45+
* `@xrmx <http://github.com/xrmx>`__: search: mark more strings for translation (`#4438 <https://github.com/rtfd/readthedocs.org/pull/4438>`__)
46+
* `@Alig1493 <http://github.com/Alig1493>`__: Fix for issue #4092: Remove unused field from Project model (`#4431 <https://github.com/rtfd/readthedocs.org/pull/4431>`__)
47+
* `@mashrikt <http://github.com/mashrikt>`__: Remove pytest _describe (`#4429 <https://github.com/rtfd/readthedocs.org/pull/4429>`__)
48+
* `@xrmx <http://github.com/xrmx>`__: static: use modern getJSON callbacks (`#4382 <https://github.com/rtfd/readthedocs.org/pull/4382>`__)
49+
* `@jaraco <http://github.com/jaraco>`__: Script for creating a project (`#4370 <https://github.com/rtfd/readthedocs.org/pull/4370>`__)
50+
* `@xrmx <http://github.com/xrmx>`__: make it easier to use a different default theme (`#4278 <https://github.com/rtfd/readthedocs.org/pull/4278>`__)
51+
* `@humitos <http://github.com/humitos>`__: Document alternate domains for business site (`#4271 <https://github.com/rtfd/readthedocs.org/pull/4271>`__)
52+
* `@xrmx <http://github.com/xrmx>`__: restapi/client: don't use DRF parser for parsing (`#4160 <https://github.com/rtfd/readthedocs.org/pull/4160>`__)
53+
* `@julienmalard <http://github.com/julienmalard>`__: New languages (`#3759 <https://github.com/rtfd/readthedocs.org/pull/3759>`__)
54+
* `@stsewd <http://github.com/stsewd>`__: Improve installation guide (`#3631 <https://github.com/rtfd/readthedocs.org/pull/3631>`__)
55+
* `@stsewd <http://github.com/stsewd>`__: Allow to hide version warning (`#3595 <https://github.com/rtfd/readthedocs.org/pull/3595>`__)
56+
* `@Alig1493 <http://github.com/Alig1493>`__: [Fixed #872] Filter Builds according to commit (`#3544 <https://github.com/rtfd/readthedocs.org/pull/3544>`__)
57+
* `@stsewd <http://github.com/stsewd>`__: Make slug field a valid DNS label (`#3464 <https://github.com/rtfd/readthedocs.org/pull/3464>`__)
58+
159
Version 2.8.0
260
-------------
361

readthedocs/builds/models.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,55 @@
22
"""Models for the builds app."""
33

44
from __future__ import (
5-
absolute_import, division, print_function, unicode_literals)
5+
absolute_import,
6+
division,
7+
print_function,
8+
unicode_literals,
9+
)
610

711
import logging
812
import os.path
913
import re
10-
from builtins import object
1114
from shutil import rmtree
1215

16+
from builtins import object
1317
from django.conf import settings
1418
from django.core.urlresolvers import reverse
1519
from django.db import models
1620
from django.utils.encoding import python_2_unicode_compatible
17-
from django.utils.translation import ugettext_lazy as _
1821
from django.utils.translation import ugettext
22+
from django.utils.translation import ugettext_lazy as _
1923
from guardian.shortcuts import assign
2024
from taggit.managers import TaggableManager
2125

2226
from readthedocs.core.utils import broadcast
2327
from readthedocs.projects.constants import (
24-
BITBUCKET_URL, GITHUB_URL, GITLAB_URL, PRIVACY_CHOICES, PRIVATE)
28+
BITBUCKET_URL,
29+
GITHUB_URL,
30+
GITLAB_URL,
31+
PRIVACY_CHOICES,
32+
PRIVATE,
33+
)
2534
from readthedocs.projects.models import APIProject, Project
2635

2736
from .constants import (
28-
BRANCH, BUILD_STATE, BUILD_STATE_FINISHED, BUILD_TYPES, LATEST,
29-
NON_REPOSITORY_VERSIONS, STABLE, TAG, VERSION_TYPES)
37+
BRANCH,
38+
BUILD_STATE,
39+
BUILD_STATE_FINISHED,
40+
BUILD_TYPES,
41+
LATEST,
42+
NON_REPOSITORY_VERSIONS,
43+
STABLE,
44+
TAG,
45+
VERSION_TYPES,
46+
)
3047
from .managers import VersionManager
3148
from .querysets import BuildQuerySet, RelatedBuildQuerySet, VersionQuerySet
3249
from .utils import (
33-
get_bitbucket_username_repo, get_github_username_repo,
34-
get_gitlab_username_repo)
50+
get_bitbucket_username_repo,
51+
get_github_username_repo,
52+
get_gitlab_username_repo,
53+
)
3554
from .version_slug import VersionSlugField
3655

3756
DEFAULT_VERSION_PRIVACY_LEVEL = getattr(
@@ -193,6 +212,10 @@ def identifier_friendly(self):
193212
return self.identifier[:8]
194213
return self.identifier
195214

215+
@property
216+
def is_editable(self):
217+
return self.type == BRANCH
218+
196219
def get_subdomain_url(self):
197220
private = self.privacy_level == PRIVATE
198221
return self.project.get_docs_url(

readthedocs/builds/views.py

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
13
"""Views for builds app."""
24

3-
from __future__ import absolute_import
4-
from builtins import object
5+
from __future__ import (
6+
absolute_import,
7+
division,
8+
print_function,
9+
unicode_literals,
10+
)
11+
512
import logging
613

7-
from django.shortcuts import get_object_or_404
8-
from django.views.generic import ListView, DetailView
14+
from builtins import object
15+
from django.contrib.auth.decorators import login_required
16+
from django.core.urlresolvers import reverse
917
from django.http import (
1018
HttpResponseForbidden,
1119
HttpResponsePermanentRedirect,
1220
HttpResponseRedirect,
1321
)
14-
from django.contrib.auth.decorators import login_required
15-
from readthedocs.core.permissions import AdminPermission
16-
from django.core.urlresolvers import reverse
22+
from django.shortcuts import get_object_or_404
1723
from django.utils.decorators import method_decorator
24+
from django.views.generic import DetailView, ListView
1825

1926
from readthedocs.builds.models import Build, Version
27+
from readthedocs.core.permissions import AdminPermission
2028
from readthedocs.core.utils import trigger_build
2129
from readthedocs.projects.models import Project
2230

23-
2431
log = logging.getLogger(__name__)
2532

2633

@@ -31,9 +38,11 @@ def get_queryset(self):
3138
self.project_slug = self.kwargs.get('project_slug', None)
3239
self.project = get_object_or_404(
3340
Project.objects.protected(self.request.user),
34-
slug=self.project_slug
41+
slug=self.project_slug,
42+
)
43+
queryset = Build.objects.public(
44+
user=self.request.user, project=self.project
3545
)
36-
queryset = Build.objects.public(user=self.request.user, project=self.project)
3746

3847
return queryset
3948

@@ -54,20 +63,25 @@ def post(self, request, project_slug):
5463
slug=version_slug,
5564
)
5665

57-
trigger_build(project=project, version=version)
58-
return HttpResponseRedirect(reverse('builds_project_list', args=[project.slug]))
66+
_, build = trigger_build(project=project, version=version)
67+
return HttpResponseRedirect(
68+
reverse('builds_detail', args=[project.slug, build.pk]),
69+
)
5970

6071

6172
class BuildList(BuildBase, BuildTriggerMixin, ListView):
6273

6374
def get_context_data(self, **kwargs):
6475
context = super(BuildList, self).get_context_data(**kwargs)
6576

66-
active_builds = self.get_queryset().exclude(state="finished").values('id')
77+
active_builds = self.get_queryset().exclude(state='finished'
78+
).values('id')
6779

6880
context['project'] = self.project
6981
context['active_builds'] = active_builds
70-
context['versions'] = Version.objects.public(user=self.request.user, project=self.project)
82+
context['versions'] = Version.objects.public(
83+
user=self.request.user, project=self.project
84+
)
7185
context['build_qs'] = self.get_queryset()
7286

7387
return context
@@ -84,9 +98,14 @@ def get_context_data(self, **kwargs):
8498

8599
# Old build view redirects
86100

101+
87102
def builds_redirect_list(request, project_slug): # pylint: disable=unused-argument
88-
return HttpResponsePermanentRedirect(reverse('builds_project_list', args=[project_slug]))
103+
return HttpResponsePermanentRedirect(
104+
reverse('builds_project_list', args=[project_slug])
105+
)
89106

90107

91108
def builds_redirect_detail(request, project_slug, pk): # pylint: disable=unused-argument
92-
return HttpResponsePermanentRedirect(reverse('builds_detail', args=[project_slug, pk]))
109+
return HttpResponsePermanentRedirect(
110+
reverse('builds_detail', args=[project_slug, pk])
111+
)

readthedocs/core/admin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""Django admin interface for core models."""
22

33
from __future__ import absolute_import
4-
from datetime import datetime, timedelta
4+
from datetime import timedelta
55

66
from django.contrib import admin
77
from django.contrib.auth.models import User
88
from django.contrib.auth.admin import UserAdmin
99
from django.utils.translation import ugettext_lazy as _
10+
from django.utils import timezone
1011

1112
from readthedocs.core.models import UserProfile
1213
from readthedocs.projects.models import Project
@@ -50,7 +51,7 @@ def queryset(self, request, queryset):
5051
if self.value() == self.PROJECT_BUILT:
5152
return queryset.filter(projects__versions__built=True)
5253
if self.value() == self.PROJECT_RECENT:
53-
recent_date = datetime.today() - timedelta(days=365)
54+
recent_date = timezone.now() - timedelta(days=365)
5455
return queryset.filter(projects__builds__date__gt=recent_date)
5556

5657

readthedocs/core/fixtures/eric.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"is_active": true,
1010
"is_superuser": false,
1111
"is_staff": true,
12-
"last_login": "2010-08-14 01:51:05",
12+
"last_login": "2010-08-14T01:51:05+00:00",
1313
"groups": [],
1414
"user_permissions": [],
1515
"password": "pbkdf2_sha256$30000$Vs87OlKZEzCb$nUw1o5pGQw7ff/QhnleSpUOupBaT1DogZrVaoZyQRyc=",
1616
"email": "[email protected]",
17-
"date_joined": "2010-08-14 01:50:58"
17+
"date_joined": "2010-08-14T01:50:58+00:00"
1818
}
1919
},
2020
{
@@ -27,12 +27,12 @@
2727
"is_active": true,
2828
"is_superuser": false,
2929
"is_staff": true,
30-
"last_login": "2010-08-14 01:51:05",
30+
"last_login": "2010-08-14T01:51:05+00:00",
3131
"groups": [],
3232
"user_permissions": [],
3333
"password": "pbkdf2_sha256$30000$Vs87OlKZEzCb$nUw1o5pGQw7ff/QhnleSpUOupBaT1DogZrVaoZyQRyc=",
3434
"email": "[email protected]",
35-
"date_joined": "2010-08-14 01:50:58"
35+
"date_joined": "2010-08-14T01:50:58+00:00"
3636
}
3737
},
3838
{
@@ -45,12 +45,12 @@
4545
"is_active": true,
4646
"is_superuser": true,
4747
"is_staff": true,
48-
"last_login": "2010-08-14 01:51:05",
48+
"last_login": "2010-08-14T01:51:05+00:00",
4949
"groups": [],
5050
"user_permissions": [],
5151
"password": "pbkdf2_sha256$30000$Vs87OlKZEzCb$nUw1o5pGQw7ff/QhnleSpUOupBaT1DogZrVaoZyQRyc=",
5252
"email": "[email protected]",
53-
"date_joined": "2010-08-14 01:50:58"
53+
"date_joined": "2010-08-14T01:50:58+00:00"
5454
}
5555
}
5656
]

readthedocs/core/management/commands/clean_builds.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""Clean up stable build paths per project version"""
22

33
from __future__ import absolute_import
4-
from datetime import datetime, timedelta
4+
from datetime import timedelta
55
import logging
66
from optparse import make_option
77

88
from django.core.management.base import BaseCommand
99
from django.db.models import Max
10+
from django.utils import timezone
1011

1112
from readthedocs.builds.models import Build, Version
1213

@@ -35,7 +36,7 @@ def add_arguments(self, parser):
3536

3637
def handle(self, *args, **options):
3738
"""Find stale builds and remove build paths"""
38-
max_date = datetime.now() - timedelta(days=options['days'])
39+
max_date = timezone.now() - timedelta(days=options['days'])
3940
queryset = (Build.objects
4041
.values('project', 'version')
4142
.annotate(max_date=Max('date'))

readthedocs/core/static/core/js/readthedocs-doc-embed.js

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

0 commit comments

Comments
 (0)