Skip to content

Commit bd55e6f

Browse files
stsewdhumitos
authored andcommitted
Don't assume build isn't None in a docker build env
This is kind of the same we hit with a local env #6503
1 parent d6ff49f commit bd55e6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def __init__(self, *args, **kwargs):
792792
self.container = None
793793
self.container_name = slugify(
794794
'build-{build}-project-{project_id}-{project_name}'.format(
795-
build=self.build.get('id'),
795+
build=self.build.get('id') if self.build else '',
796796
project_id=self.project.pk,
797797
project_name=self.project.slug,
798798
)[:DOCKER_HOSTNAME_MAX_LEN],
@@ -931,7 +931,7 @@ def get_client(self):
931931
# Instead, give the user a generic failure
932932
raise BuildEnvironmentError(
933933
BuildEnvironmentError.GENERIC_WITH_BUILD_ID.format(
934-
build_id=self.build['id'],
934+
build_id=self.build.get('id') if self.build else '',
935935
),
936936
)
937937

0 commit comments

Comments
 (0)