Merge lp:~deryck/launchpad/wrong-bug-number-edit-page-439449 into lp:launchpad

Proposed by Deryck Hodge
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~deryck/launchpad/wrong-bug-number-edit-page-439449
Merge into: lp:launchpad
Diff against target: 41 lines
2 files modified
lib/lp/bugs/browser/bug.py (+2/-1)
lib/lp/bugs/stories/bugs/xx-bug-edit.txt (+11/-0)
To merge this branch: bzr merge lp:~deryck/launchpad/wrong-bug-number-edit-page-439449
Reviewer Review Type Date Requested Status
Michael Nelson (community) release-critical Approve
Gavin Panella (community) Approve
Review via email: mp+14224@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

This fixes bug 439449. We were using bugtask.id instead of bug.id on
title and heading (label and page_title) for a bug's +edit page.

I added a small test to cover that the correct bug ID is displayed, too.

./bin/test -vv -t xx-bug-edit.txt

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/bugs/browser/bug.py
  lib/lp/bugs/stories/bugs/xx-bug-edit.txt

== Pylint notices ==

lib/lp/bugs/browser/bug.py
    44: [F0401] Unable to import 'lazr.enum' (No module named enum)
    45: [F0401] Unable to import 'lazr.lifecycle.event' (No module named
lifecycle)
    46: [F0401] Unable to import 'lazr.lifecycle.snapshot' (No module
named lifecycle)
    47: [F0401] Unable to import 'lazr.restful.interfaces' (No module
named restful)

Revision history for this message
Gavin Panella (allenap) wrote :

<allenap> deryck: Perhaps add a comment to BugEditView.__init__ saying that context is always an IBugTask.
<deryck> allenap, sure, I can do that.

review: Approve
Revision history for this message
Michael Nelson (michael.nelson) wrote :

OK, given this is very small and persuaded that it's quite important :)

review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py 2009-10-26 14:33:26 +0000
+++ lib/lp/bugs/browser/bug.py 2009-10-30 16:31:13 +0000
@@ -560,13 +560,14 @@
560 _confirm_new_tags = False560 _confirm_new_tags = False
561561
562 def __init__(self, context, request):562 def __init__(self, context, request):
563 """context is always an IBugTask."""
563 BugEditViewBase.__init__(self, context, request)564 BugEditViewBase.__init__(self, context, request)
564 self.notifications = []565 self.notifications = []
565566
566 @property567 @property
567 def label(self):568 def label(self):
568 """The form label."""569 """The form label."""
569 return 'Edit details for bug #%d' % self.context.id570 return 'Edit details for bug #%d' % self.context.bug.id
570571
571 @property572 @property
572 def page_title(self):573 def page_title(self):
573574
=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-edit.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-edit.txt 2009-08-12 11:49:59 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-edit.txt 2009-10-30 16:31:13 +0000
@@ -13,6 +13,17 @@
13 ...13 ...
14 ...blackhole is already in use by another bug...14 ...blackhole is already in use by another bug...
1515
16The user should be able to look at the page title or heading and
17see the bug number being edited.
18
19 >>> user_browser.open(
20 ... 'http://bugs.launchpad.dev/jokosher/+bug/11/+edit')
21 >>> print user_browser.title
22 Edit details for bug #11 ...
23 >>> main = find_main_content(user_browser.contents)
24 >>> print extract_text(main.h1)
25 Edit details for bug #11
26
16And now we show that any logged-in user can edit public bugs. 27And now we show that any logged-in user can edit public bugs.
1728
18 >>> browser = setupBrowser(auth='Basic no-priv@canonical.com:test')29 >>> browser = setupBrowser(auth='Basic no-priv@canonical.com:test')