Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions readthedocs/builds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from readthedocs.builds.constants import BRANCH
from readthedocs.builds.constants import BUILD_FINAL_STATES
from readthedocs.builds.constants import BUILD_STATE
from readthedocs.builds.constants import BUILD_STATE_CANCELLED
from readthedocs.builds.constants import BUILD_STATE_FINISHED
from readthedocs.builds.constants import BUILD_STATE_TRIGGERED
from readthedocs.builds.constants import BUILD_STATUS_CHOICES
Expand Down Expand Up @@ -1064,6 +1065,17 @@ def get_commit_url(self):

return None

@property
def get_result_display(self):
Comment thread
ericholscher marked this conversation as resolved.
Outdated
"""Human-readable build result combining state and success."""
if self.state == BUILD_STATE_FINISHED:
if self.success:
return _("Build passed")
return _("Build failed")
if self.state == BUILD_STATE_CANCELLED:
return _("Build cancelled")
return _("Building")

@property
def finished(self):
"""Return if build has an end state."""
Expand Down