# HG changeset patch # User Mads Kiilerich # Date 2015-08-17 01:11:42 # Node ID 4eb390c2d2bddced1e69a05557b3188db50fd53a # Parent 7570d6665f0f8ef33fbc3a0983833088f815449a pullrequests: require extra confirmation before deleting a PR with comments Make sure we don't lose any valueable data. A PR without comments doesn't have much value. diff --git a/kallithea/templates/pullrequests/pullrequest_data.html b/kallithea/templates/pullrequests/pullrequest_data.html --- a/kallithea/templates/pullrequests/pullrequest_data.html +++ b/kallithea/templates/pullrequests/pullrequest_data.html @@ -65,7 +65,10 @@ id="remove_${pr.pull_request_id}" name="remove_${pr.pull_request_id}" title="${_('Delete Pull Request')}" - onclick="return confirm('${_('Confirm to delete this pull request')}');"> + onclick="return confirm('${_('Confirm to delete this pull request')}') + && ((${len(pr.comments)} == 0) || + confirm('${_('Confirm again to delete this pull request with %s comments') % len(pr.comments)}')) + "> ${h.end_form()}