Skip to content

Commit f959b2a

Browse files
authored
Project: use latest version for syncing versions (#12461)
We should refactor this task so it doesn't require a version, but that's a bigger change... This is basically the same as it was before, as LATEST is the only version that its identifier is the same as the default branch. I'm doing small refactors to rely less on get_default_branch, as that contains some extra logic that we already run to have latest always in sync.
1 parent c7c96de commit f959b2a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

readthedocs/core/views/hooks.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,9 @@ def trigger_sync_versions(project):
102102
return None
103103

104104
try:
105-
version_identifier = project.get_default_branch()
106-
version = project.versions.filter(
107-
identifier=version_identifier,
108-
).first()
105+
version = project.get_latest_version()
109106
if not version:
110-
log.info("Unable to sync from version.", version_identifier=version_identifier)
107+
log.info("Unable to sync versions, project doesn't have a valid latest version.")
111108
return None
112109

113110
if project.has_feature(Feature.SKIP_SYNC_VERSIONS):

0 commit comments

Comments
 (0)