Skip to content

Commit d075d54

Browse files
committed
Suggest to open an issue only if the error is generic
1 parent 02979dc commit d075d54

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

readthedocs/builds/views.py

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from requests.utils import quote
2828
from urllib.parse import urlparse
2929

30+
from readthedocs.doc_builder.exceptions import BuildEnvironmentError
3031
from readthedocs.builds.models import Build, Version
3132
from readthedocs.core.permissions import AdminPermission
3233
from readthedocs.core.utils import trigger_build
@@ -108,6 +109,12 @@ class BuildDetail(BuildBase, DetailView):
108109

109110
def get_context_data(self, **kwargs):
110111
context = super(BuildDetail, self).get_context_data(**kwargs)
112+
113+
build = self.get_object()
114+
if build.error != BuildEnvironmentError.GENERIC_WITH_BUILD_ID.format(build_id=build.pk):
115+
# Do not suggest to open an issue if the error is not generic
116+
return context
117+
111118
context['project'] = self.project
112119
scheme = (
113120
'https://github.com/rtfd/readthedocs.org/issues/new'

readthedocs/templates/builds/build_detail.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,11 @@ <h3>{% trans "Error" %}</h3>
179179
</p>
180180
<p>
181181
{% block github_issue_link %}
182-
{% blocktrans with url=issue_url %}
183-
<a href="{{ url }}">Report any build issues here</a>.
184-
{% endblocktrans %}
182+
{% if issue_url %}
183+
{% blocktrans trimmed with url=issue_url %}
184+
<a href="{{ url }}">Report any build issues here</a>.
185+
{% endblocktrans %}
186+
{% endif %}
185187
{% endblock %}
186188
</p>
187189
</div>

0 commit comments

Comments
 (0)