Skip to content

Commit

Permalink
fix key error for some tox-results
Browse files Browse the repository at this point in the history
fixes issue apihackers#10
  • Loading branch information
con-f-use committed Nov 27, 2021
1 parent 32bab6a commit b672326
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion devpi_semantic_ui/templates/index.pt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<td>
<tal:files condition="package.files" repeat="file package.files">
<tal:file define="toxresults file.get('toxresults', []);
failed None if not toxresults else any(x['failed'] for x in toxresults)">
failed None if not toxresults else any(x.get('failed', False) for x in toxresults)">
<a href="${file.url}">${file.title}</a>
<tal:tests condition="failed is not None">
(<a href="${package.make_toxresults_url(basename=file.basename)}"
Expand Down
4 changes: 2 additions & 2 deletions devpi_semantic_ui/templates/toxresult.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<h1 class="ui header">${title}</h1>

<div tal:repeat="toxresult toxresults"
tal:attributes="class 'toxresult ' + ('failed' if toxresult.failed else 'passed')">
tal:attributes="class 'toxresult ' + ('failed' if getattr(toxresult, 'failed', False) else 'passed')">
<h2 id="${toxresult._key}"
tal:attributes="class 'ui dividing header toxresult_title ' + ('red' if toxresult.failed else 'green')">
tal:attributes="class 'ui dividing header toxresult_title ' + ('red' if getattr(toxresult, 'failed', False) else 'green')">
${toxresult.envname}
&nbsp;
<a class="ui small blue tag label" title="Python version">🐍 ${toxresult.get('pyversion')}</a>
Expand Down
4 changes: 2 additions & 2 deletions devpi_semantic_ui/templates/version.pt
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
<a tal:repeat="toxresult file.get('toxresults')"
class="mini ui labeled button" tabindex="0"
href="${make_toxresult_url(basename=file.basename, toxresult=toxresult.basename)}#${toxresult._key}">
<div tal:attributes="class 'mini ui button ' + ('red' if toxresult.failed else 'green')">
<div tal:attributes="class 'mini ui button ' + ('red' if getattr(toxresult, 'failed', False) else 'green')">
${toxresult.envname}
</div>
<span tal:attributes="class 'ui left pointing label ' + ('orange' if toxresult.failed else 'olive')">
<span tal:attributes="class 'ui left pointing label ' + ('orange' if getattr(toxresult, 'failed', False) else 'olive')">
${toxresult.get('pyversion')}
</span>
</a>
Expand Down

0 comments on commit b672326

Please sign in to comment.