We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 63966d3 + c529b58 commit dc98b58Copy full SHA for dc98b58
readthedocs/projects/tasks.py
@@ -1387,11 +1387,12 @@ def warn(self, msg):
1387
1388
def clean_build(version_pk):
1389
"""Clean the files used in the build of the given version."""
1390
- version = Version.objects.get_object_or_log(pk=version_pk)
1391
- if (
1392
- not version or
1393
- not version.project.has_feature(Feature.CLEAN_AFTER_BUILD)
1394
- ):
+ try:
+ version = SyncRepositoryMixin.get_version(version_pk)
+ except Exception:
+ log.exception('Error while fetching the version from the api')
+ return False
1395
+ if not version.project.has_feature(Feature.CLEAN_AFTER_BUILD):
1396
log.info(
1397
'Skipping build files deletetion for version: %s',
1398
version_pk,
0 commit comments