launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #11438
[Merge] lp:~stevenk/launchpad/destroy-target-uses-malone into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/destroy-target-uses-malone into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #149009 in Launchpad itself: "BugTask.target_uses_malone is pointless"
https://bugs.launchpad.net/launchpad/+bug/149009
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/destroy-target-uses-malone/+merge/121958
Rip out IBugTask.target_uses_malone for being pointless.
--
https://code.launchpad.net/~stevenk/launchpad/destroy-target-uses-malone/+merge/121958
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/destroy-target-uses-malone into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2012-08-21 00:34:02 +0000
+++ lib/lp/bugs/browser/bugtask.py 2012-08-29 22:21:19 +0000
@@ -1348,7 +1348,7 @@
@cachedproperty
def editable_field_names(self):
"""Return the names of fields the user has permission to edit."""
- if self.context.target_uses_malone:
+ if self.context.pillar.official_malone:
# Don't edit self.field_names directly, because it's shared by all
# BugTaskEditView instances.
editable_field_names = set(self.default_field_names)
@@ -1503,7 +1503,7 @@
values=importance_vocab_items,
default=BugTaskImportance.UNDECIDED))
- if self.context.target_uses_malone:
+ if self.context.pillar.official_malone:
self.form_fields = self.form_fields.omit('bugwatch')
elif (self.context.bugwatch is not None and
@@ -1524,7 +1524,7 @@
def _getReadOnlyFieldNames(self):
"""Return the names of fields that will be rendered read only."""
- if self.context.target_uses_malone:
+ if self.context.pillar.official_malone:
read_only_field_names = []
if not self.user_has_privileges:
@@ -4131,7 +4131,7 @@
If yes, return True, otherwise return False.
"""
bugtask = self.context
- edit_allowed = bugtask.target_uses_malone or bugtask.bugwatch
+ edit_allowed = bugtask.pillar.official_malone or bugtask.bugwatch
if bugtask.bugwatch:
bugtracker = bugtask.bugwatch.bugtracker
edit_allowed = (
=== modified file 'lib/lp/bugs/browser/widgets/bugtask.py'
--- lib/lp/bugs/browser/widgets/bugtask.py 2012-06-29 08:40:05 +0000
+++ lib/lp/bugs/browser/widgets/bugtask.py 2012-08-29 22:21:19 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Widgets related to IBugTask."""
@@ -586,7 +586,7 @@
'a', href=canonical_url(assignee),
contents="%s %s" % (person_img, escape(assignee.displayname)))
else:
- if bugtask.target_uses_malone:
+ if bugtask.pillar.official_malone:
return renderElement('i', contents='not assigned')
else:
return renderElement('i', contents='unknown')
=== modified file 'lib/lp/bugs/configure.zcml'
--- lib/lp/bugs/configure.zcml 2012-08-16 00:50:36 +0000
+++ lib/lp/bugs/configure.zcml 2012-08-29 22:21:19 +0000
@@ -221,7 +221,6 @@
asEmailHeaderValue
getDelta
pillar
- target_uses_malone
bugtask_branches
conjoined_master
conjoined_slave
=== modified file 'lib/lp/bugs/doc/bugtask-display-widgets.txt'
--- lib/lp/bugs/doc/bugtask-display-widgets.txt 2011-01-11 11:51:27 +0000
+++ lib/lp/bugs/doc/bugtask-display-widgets.txt 2012-08-29 22:21:19 +0000
@@ -52,7 +52,7 @@
>>> bug_nine = getUtility(IBugSet).get(9)
>>> thunderbird_bugtask = bug_nine.bugtasks[0]
- >>> thunderbird_bugtask.target_uses_malone
+ >>> thunderbird_bugtask.pillar.official_malone
False
>>> assignee_field = IBugTask['assignee'].bind(thunderbird_bugtask)
>>> assignee_widget = AssigneeDisplayWidget(assignee_field, None, None)
=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
--- lib/lp/bugs/interfaces/bugtask.py 2012-08-16 04:36:09 +0000
+++ lib/lp/bugs/interfaces/bugtask.py 2012-08-29 22:21:19 +0000
@@ -544,8 +544,6 @@
title=_('Target'), required=True, schema=Interface, # IBugTarget
readonly=True,
description=_("The software in which this bug should be fixed.")))
- target_uses_malone = Bool(
- title=_("Whether the bugtask's target uses Launchpad officially"))
title = exported(
Text(title=_("The title of the bug related to this bugtask"),
readonly=True))
=== modified file 'lib/lp/bugs/model/bugtask.py'
--- lib/lp/bugs/model/bugtask.py 2012-08-24 06:28:32 +0000
+++ lib/lp/bugs/model/bugtask.py 2012-08-29 22:21:19 +0000
@@ -760,13 +760,6 @@
# setter methods directly.
setattr(self, synched_attr, PassthroughValue(slave_attr_value))
- @property
- def target_uses_malone(self):
- """See `IBugTask`"""
- # XXX sinzui 2007-10-04 bug=149009:
- # This property is not needed. Code should inline this implementation.
- return (self.pillar.bug_tracking_usage == ServiceUsage.LAUNCHPAD)
-
def transitionToMilestone(self, new_milestone, user):
"""See `IBugTask`."""
if not self.userHasBugSupervisorPrivileges(user):
=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
--- lib/lp/bugs/model/tests/test_bugtask.py 2012-08-28 09:57:40 +0000
+++ lib/lp/bugs/model/tests/test_bugtask.py 2012-08-29 22:21:19 +0000
@@ -1194,7 +1194,7 @@
"""
non_malone_using_bugtasks = [
related_task for related_task in bugtask.related_tasks
- if not related_task.target_uses_malone]
+ if not related_task.pillar.official_malone]
pending_bugwatch_bugtasks = [
related_bugtask for related_bugtask in non_malone_using_bugtasks
if related_bugtask.bugwatch is None]
=== modified file 'lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt'
--- lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt 2011-12-24 17:49:30 +0000
+++ lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt 2012-08-29 22:21:19 +0000
@@ -50,7 +50,7 @@
>>> bug_two = getUtility(IBugSet).get(2)
>>> for bugtask in bug_two.bugtasks:
- ... if not bugtask.target_uses_malone:
+ ... if not bugtask.pillar.official_malone:
... bugtask.transitionToStatus(
... BugTaskStatus.INVALID, getUtility(ILaunchBag).user)
=== modified file 'lib/lp/bugs/templates/bugtask-edit-form.pt'
--- lib/lp/bugs/templates/bugtask-edit-form.pt 2012-02-10 07:56:28 +0000
+++ lib/lp/bugs/templates/bugtask-edit-form.pt 2012-08-29 22:21:19 +0000
@@ -204,7 +204,7 @@
colspan="2" style="white-space: nowrap" />
</tr>
</table>
- <table tal:condition="not:context/target_uses_malone">
+ <table tal:condition="not:context/pillar/official_malone">
<tr>
<td>
<label
Follow ups