Merge lp://staging/~adeuring/launchpad/bug-588276 into lp://staging/launchpad

Proposed by Abel Deuring
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 11018
Proposed branch: lp://staging/~adeuring/launchpad/bug-588276
Merge into: lp://staging/launchpad
Diff against target: 524 lines (+343/-11)
9 files modified
lib/lp/bugs/browser/bugtarget.py (+45/-1)
lib/lp/bugs/browser/tests/test_bugtarget_configure.py (+5/-1)
lib/lp/bugs/browser/tests/test_bugtarget_filebug.py (+264/-0)
lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.txt (+18/-2)
lib/lp/registry/browser/distribution.py (+2/-1)
lib/lp/registry/browser/distributionsourcepackage.py (+1/-0)
lib/lp/registry/browser/project.py (+3/-2)
lib/lp/registry/browser/tests/distribution-views.txt (+4/-3)
lib/lp/registry/browser/tests/distributionsourcepackage-views.txt (+1/-1)
To merge this branch: bzr merge lp://staging/~adeuring/launchpad/bug-588276
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+27606@code.staging.launchpad.net

Description of the change

This branch fixes bug 588276: "Enable use of bug_reported_acknowledgement in web UI"

It adds the field bug_reported_acknowledgement to edit forms for IDistribution, IDistributionSourcePackage, IProduct, IProjectGroup; FileBugViewBase.submit_bug_action() now tries to retrieve the bug filing acknowledgement message from the bug target and its parents. This is done in the new method getAcknowledgementMessage().

The property bug_reported_acknowledgement is defined for all bug targets, but only the four bug target types IDistribution, IDistributionSourcePackage, IProduct, IProjectGroup have database columns for it; other bug targets (IProductSeries, IDistroSeries, ISourcePackage) inherit it from their parents.

This acquisition logic is fine, but it ignores the case that a customized message is defined for a project group but not for a project within the project group, or for a distribution but not for DistributionSourcePackage. We should show in this case not the standard messae, but the message defined for the project group or the distribution, respectively.

Hence I duplicated/generalized the "acquisition logic" in the browser class method getAcknowledgementmessage() so that it works for DSP -> distribtuion and product -> project group too.

tests:

bin/test -t test_bugtarget_filebug (for getAcknowledgementmessage())
bin/test -t xx-bug-reporting-guidelines.txt (changes edit forms; shows that the notification shown in the web UI when a bug has been filed is customnizable).

no lint

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) wrote :

> + "bug_reported_acknowledgement",
> ]
> custom_widget('bugtracker', ProductBugTrackerWidget)
>
> @@ -443,7 +446,7 @@
> else:
> private = False
>
> - notifications = ["Thank you for your bug report."]
> + notifications = [self.getAcknowledgementMessage(self.context)]
> params = CreateBugParams(
> title=title, comment=comment, owner=self.user,
> security_related=security_related, private=private,
> @@ -775,6 +778,47 @@
> })
> return guidelines
>
> + default_bug_reported_acknowledgement = "Thank you for your bug report."
> +
> + def getAcknowledgementMessage(self, context):
> + """An acknowlegement message displayed to the user."""
> + # If a given context has not a custom message, we go up in the

Minor grammatical nit pick: "does not have a" reads better than "has not a".

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.