Merge ~pappacena/launchpad:testfix-ignore-unset-error-on-mp-conversation into launchpad:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 93f10ab7b475ae170feea5d1ca47649952e52fe3
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:testfix-ignore-unset-error-on-mp-conversation
Merge into: launchpad:master
Diff against target: 22 lines (+9/-2)
1 file modified
lib/lp/code/templates/git-macros.pt (+9/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+401485@code.launchpad.net

Commit message

Avoiding crash on ref-commits macro when the view doesn't define commit_infos_message

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/code/templates/git-macros.pt b/lib/lp/code/templates/git-macros.pt
2index a8216c2..cb0f302 100644
3--- a/lib/lp/code/templates/git-macros.pt
4+++ b/lib/lp/code/templates/git-macros.pt
5@@ -144,8 +144,15 @@
6 }
7 </style>
8 <dl class="commit">
9- <div tal:condition="view/commit_infos_message" class="pending-update">
10- <p tal:content="structure view/commit_infos_message" />
11+ <tal:comment condition="nothing">
12+ commit_infos_message is not mandatory, and it's used to communicate
13+ error messages. It's ok if a view doesn't define it when including
14+ this macro.
15+ </tal:comment>
16+ <div tal:define="commit_infos_message python: getattr(view, 'commit_infos_message', None)"
17+ tal:condition="commit_infos_message"
18+ class="pending-update">
19+ <p tal:content="structure commit_infos_message" />
20 </div>
21 <tal:commit repeat="commit_info commit_infos">
22 <metal:commit-text use-macro="ref/@@+macros/commit-text"/>