Merge lp:~wallyworld/launchpad/mp-link-not-visible into lp:launchpad

Proposed by Ian Booth
Status: Merged
Approved by: Ian Booth
Approved revision: no longer in the source branch.
Merged at revision: 12117
Proposed branch: lp:~wallyworld/launchpad/mp-link-not-visible
Merge into: lp:launchpad
Diff against target: 51 lines (+9/-11)
3 files modified
lib/lp/code/browser/branch.py (+0/-1)
lib/lp/code/stories/branches/xx-branchmergeproposals.txt (+1/-10)
lib/lp/code/stories/branches/xx-propose-for-merging.txt (+8/-0)
To merge this branch: bzr merge lp:~wallyworld/launchpad/mp-link-not-visible
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+43850@code.launchpad.net

Commit message

[r=bac][ui=none][bug=687703] Always show Register Merge Proposal link on branch page even if user is not logged in. They will be prompted to log in if required.

Description of the change

= Summary =

Small fix to always show the Propose for Merging link on the branch page even if the user is not logged in.
They will just be prompted to login before being redirected to the right place. This is how other similar
links on that page work eg Link to Bug

= Implementation =

Remove @enabled_with_permission('launchpad.AnyPerson') decorator from register_merge()

= Tests =

Added to xx-propose-for-merging doc test to check link is there even if not logged in.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/code/browser/branch.py
  lib/lp/code/stories/branches/xx-propose-for-merging.txt

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Hi Ian,

Looks good except for

s/there is if there/there if there/

review: Approve (code)
Revision history for this message
Ian Booth (wallyworld) wrote :

> Hi Ian,
>
> Looks good except for
>
> s/there is if there/there if there/

Argh, fixed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/branch.py'
2--- lib/lp/code/browser/branch.py 2010-12-14 20:29:52 +0000
3+++ lib/lp/code/browser/branch.py 2010-12-20 10:28:33 +0000
4@@ -331,7 +331,6 @@
5 text = 'Subscribe someone else'
6 return Link('+addsubscriber', text, icon='add')
7
8- @enabled_with_permission('launchpad.AnyPerson')
9 def register_merge(self):
10 text = 'Propose for merging'
11 enabled = (
12
13=== modified file 'lib/lp/code/stories/branches/xx-branchmergeproposals.txt'
14--- lib/lp/code/stories/branches/xx-branchmergeproposals.txt 2010-10-25 05:33:20 +0000
15+++ lib/lp/code/stories/branches/xx-branchmergeproposals.txt 2010-12-20 10:28:33 +0000
16@@ -47,16 +47,7 @@
17 Registering a merge proposal
18 ----------------------------
19
20-Users who are not logged on do not see the link to register.
21-
22- >>> anon_browser.open(
23- ... 'http://code.launchpad.dev/~name12/gnome-terminal/klingon')
24- >>> anon_browser.getLink('Propose for merging')
25- Traceback (most recent call last):
26- ...
27- LinkNotFoundError
28-
29-Logged in users can.
30+Logged in users can register a merge proposal.
31
32 >>> nopriv_browser = setupBrowser(auth="Basic no-priv@canonical.com:test")
33 >>> nopriv_browser.open(
34
35=== modified file 'lib/lp/code/stories/branches/xx-propose-for-merging.txt'
36--- lib/lp/code/stories/branches/xx-propose-for-merging.txt 2010-03-15 20:28:52 +0000
37+++ lib/lp/code/stories/branches/xx-propose-for-merging.txt 2010-12-20 10:28:33 +0000
38@@ -8,6 +8,14 @@
39 >>> url = canonical_url(branch)
40 >>> logout()
41
42+The Propose for merging link should be there even if there is no logged in
43+user.
44+
45+ >>> browser = setupBrowser()
46+ >>> browser.open(url)
47+ >>> browser.getLink('Propose for merging')
48+ <Link text='Propose for merging' ...
49+
50 When proposing a branch for merging, the minimum that is needed is a target
51 branch.
52