Skip to content

Commit f4e6ffd

Browse files
committed
Change stable version switching to respect active
This previously used the `machine` tag that was turned off when a user de-activated the version, but never turned back on when they re-activated it. This changes to just use the `active` flag on the Version, so we will update the stable version if the existing one is `active`, and not if it isn't, which makes _way_ more sense.
1 parent 73b693c commit f4e6ffd

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

readthedocs/projects/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def update_stable_version(self):
707707
if current_stable:
708708
identifier_updated = (
709709
new_stable.identifier != current_stable.identifier)
710-
if identifier_updated and current_stable.machine:
710+
if identifier_updated and current_stable.active:
711711
log.info(
712712
"Update stable version: {project}:{version}".format(
713713
project=self.slug,

readthedocs/projects/views/private.py

-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def project_version_detail(request, project_slug, version_slug):
176176
log.info('Removing files for version %s', version.slug)
177177
broadcast(type='app', task=tasks.clear_artifacts, args=[version.pk])
178178
version.built = False
179-
version.machine = False
180179
version.save()
181180
url = reverse('project_version_list', args=[project.slug])
182181
return HttpResponseRedirect(url)

0 commit comments

Comments
 (0)