Skip to content

Deploy hotfixes #2972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions readthedocs/builds/syncers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from django.conf import settings

from readthedocs.core.utils.extend import SettingsOverrideObject
from readthedocs.core.utils import safe_makedirs


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -127,8 +128,9 @@ def copy(cls, path, target, host, is_file=False, **__):
sync_user = getattr(settings, 'SYNC_USER', getpass.getuser())
if not is_file:
path += "/"
log.info("Local Copy %s to %s", path, target)
os.makedirs(target)
log.info("Remote Pull %s to %s", path, target)
if not is_file and not os.path.exists(target):
safe_makedirs(target)
# Add a slash when copying directories
sync_cmd = "rsync -e 'ssh -T' -av --delete {user}@{host}:{path} {target}".format(
host=host,
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/donate/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def is_gold_project(project):

def is_community_only(user, project):
"""Return True is this project or user should only be shown community ads"""
if user.is_authenticated() and user.profile.as_opt_out:
if user.is_authenticated() and not user.profile.allow_ads:
return True
if not project.allow_promos:
return True
Expand Down
12 changes: 12 additions & 0 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,20 +918,32 @@ def clear_artifacts(version_pk):
clear_html_artifacts(version)


@task()
def clear_pdf_artifacts(version):
if isinstance(version, int):
version = Version.objects.get(pk=version)
remove_dir(version.project.get_production_media_path(
type_='pdf', version_slug=version.slug))


@task()
def clear_epub_artifacts(version):
if isinstance(version, int):
version = Version.objects.get(pk=version)
remove_dir(version.project.get_production_media_path(
type_='epub', version_slug=version.slug))


@task()
def clear_htmlzip_artifacts(version):
if isinstance(version, int):
version = Version.objects.get(pk=version)
remove_dir(version.project.get_production_media_path(
type_='htmlzip', version_slug=version.slug))


@task()
def clear_html_artifacts(version):
if isinstance(version, int):
version = Version.objects.get(pk=version)
remove_dir(version.project.rtd_build_path(version=version.slug))
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ django-vanilla-views==1.0.4
jsonfield==1.0.3

requests==2.3.0
slumber==0.7.0
slumber==0.7.1
lxml==3.3.5

django-countries==3.4.1
Expand Down