Merge lp:~abentley/launchpad/forbidden-oops into lp:launchpad
Proposed by
Aaron Bentley
Status: | Merged |
---|---|
Approved by: | Edwin Grubbs |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~abentley/launchpad/forbidden-oops |
Merge into: | lp:launchpad |
Diff against target: |
130 lines (+49/-16) 4 files modified
lib/canonical/launchpad/mail/errortemplates/branch-creation-exception.txt (+2/-0) lib/lp/code/mail/codehandler.py (+8/-2) lib/lp/code/mail/tests/test_codehandler.py (+38/-13) lib/lp/code/model/branchnamespace.py (+1/-1) |
To merge this branch: | bzr merge lp:~abentley/launchpad/forbidden-oops |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Edwin Grubbs (community) | code | Approve | |
Review via email: mp+19021@code.launchpad.net |
Commit message
Mail instead of oops when branch creation forbidden
To post a comment you must log in.
= Summary =
This fixes bug #492275, "OOPS when submitting merge request for a project that
I don't have access to"
== Proposed fix ==
Catch BranchCreation exceptions and send email to the sender.
== Pre-implementation notes ==
None
== Implementation details ==
The actual exception was using %r, which was causing the name to be shown as
a unicode literal, e.g. u'~person/product'. End users shouldn't see unicode
literals, so I changed it to "%s".
Also, I sorted the imports.
== Tests == target
bin/test test_codehandler -t test_forbidden_
== Demo and Q/A ==
Use bzr send to request a merge into a project that does not allow you to
create branches in it. If you get back an error, it works. If you get back
nothing or an OOPs, it's broken.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: code/mail/ codehandler. py code/mail/ tests/test_ codehandler. py /launchpad/ mail/errortempl ates/branch- creation- exception. txt code/model/ branchnamespace .py
lib/lp/
lib/lp/
lib/canonical
lib/lp/
== Pylint notices ==
lib/lp/ code/mail/ codehandler. py
37: [F0401] Unable to import 'lazr.uri' (No module named uri)
lib/lp/ code/model/ branchnamespace .py .event' (No module named lifecycle)
20: [F0401] Unable to import 'lazr.lifecycle