Commit 1bd5bde0 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

doc_coverage_image: select py- if available

parent 02728e5c
Pipeline #15402 passed with stage
in 4 minutes and 21 seconds
......@@ -425,7 +425,11 @@ class Project(Links, NamedModel, TimeStampedModel):
return settings.PUBLIC_REGISTRY if self.public else settings.PRIVATE_REGISTRY
def doc_coverage_image(self):
return Image.objects.get(robotpkg__project=self, target__main=True)
images = Image.objects.filter(robotpkg__project=self, target__main=True)
if images.count() == 1:
return images.first()
if images.count() == 2:
return next(image for image in images if image.robotpkg.name.startswith('py-'))
def print_deps(self):
return mark_safe(', '.join(d.library.get_link() for d in self.dependencies.all()))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment