Open lehmannro opened 10 years ago
Nice idea to clean up the templates. However, I'd move the decision weather there is a proposal version or not, as a property to the reviews.Proposal
model and either return the version or the proposal itself. This would clean up a lot of code in the views too.
Have a look at the ProposalVersionManager
on how to get the latest version.
This hotfixes #95 and should replace all improper uses of the proposal's title with the latest proposal version's title.
A cleaner approach would be supplying a non-null template variable which points to the latest proposal, whether there were revisions or not, and just referring to that proposal's title. This would also clean up the whole
{% if proposal_version %}{{ proposal_version.yadda }}{% else %}{{ proposal.yadda }}{% endif %}
business all over the templates.These commits go untested.