Merge lp:~stevenk/launchpad/destroy-target-uses-malone into lp:launchpad

Proposed by Steve Kowalik on 2012-08-29
Status: Merged
Approved by: Steve Kowalik on 2012-08-30
Approved revision: no longer in the source branch.
Merged at revision: 15882
Proposed branch: lp:~stevenk/launchpad/destroy-target-uses-malone
Merge into: lp:launchpad
Diff against target: 153 lines (+10/-20)
9 files modified
lib/lp/bugs/browser/bugtask.py (+4/-4)
lib/lp/bugs/browser/widgets/bugtask.py (+2/-2)
lib/lp/bugs/configure.zcml (+0/-1)
lib/lp/bugs/doc/bugtask-display-widgets.txt (+1/-1)
lib/lp/bugs/interfaces/bugtask.py (+0/-2)
lib/lp/bugs/model/bugtask.py (+0/-7)
lib/lp/bugs/model/tests/test_bugtask.py (+1/-1)
lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt (+1/-1)
lib/lp/bugs/templates/bugtask-edit-form.pt (+1/-1)
To merge this branch: bzr merge lp:~stevenk/launchpad/destroy-target-uses-malone
Reviewer Review Type Date Requested Status
Ian Booth (community) 2012-08-29 Approve on 2012-08-30
Review via email: mp+121958@code.launchpad.net

Commit Message

Rip out IBugTask.target_uses_malone, callsites now use IBugTask.pillar.official_malone.

Description of the Change

Rip out IBugTask.target_uses_malone for being pointless.

To post a comment you must log in.
Ian Booth (wallyworld) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/browser/bugtask.py'
2--- lib/lp/bugs/browser/bugtask.py 2012-08-21 00:34:02 +0000
3+++ lib/lp/bugs/browser/bugtask.py 2012-08-29 22:21:19 +0000
4@@ -1348,7 +1348,7 @@
5 @cachedproperty
6 def editable_field_names(self):
7 """Return the names of fields the user has permission to edit."""
8- if self.context.target_uses_malone:
9+ if self.context.pillar.official_malone:
10 # Don't edit self.field_names directly, because it's shared by all
11 # BugTaskEditView instances.
12 editable_field_names = set(self.default_field_names)
13@@ -1503,7 +1503,7 @@
14 values=importance_vocab_items,
15 default=BugTaskImportance.UNDECIDED))
16
17- if self.context.target_uses_malone:
18+ if self.context.pillar.official_malone:
19 self.form_fields = self.form_fields.omit('bugwatch')
20
21 elif (self.context.bugwatch is not None and
22@@ -1524,7 +1524,7 @@
23
24 def _getReadOnlyFieldNames(self):
25 """Return the names of fields that will be rendered read only."""
26- if self.context.target_uses_malone:
27+ if self.context.pillar.official_malone:
28 read_only_field_names = []
29
30 if not self.user_has_privileges:
31@@ -4131,7 +4131,7 @@
32 If yes, return True, otherwise return False.
33 """
34 bugtask = self.context
35- edit_allowed = bugtask.target_uses_malone or bugtask.bugwatch
36+ edit_allowed = bugtask.pillar.official_malone or bugtask.bugwatch
37 if bugtask.bugwatch:
38 bugtracker = bugtask.bugwatch.bugtracker
39 edit_allowed = (
40
41=== modified file 'lib/lp/bugs/browser/widgets/bugtask.py'
42--- lib/lp/bugs/browser/widgets/bugtask.py 2012-06-29 08:40:05 +0000
43+++ lib/lp/bugs/browser/widgets/bugtask.py 2012-08-29 22:21:19 +0000
44@@ -1,4 +1,4 @@
45-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
46+# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
47 # GNU Affero General Public License version 3 (see the file LICENSE).
48
49 """Widgets related to IBugTask."""
50@@ -586,7 +586,7 @@
51 'a', href=canonical_url(assignee),
52 contents="%s %s" % (person_img, escape(assignee.displayname)))
53 else:
54- if bugtask.target_uses_malone:
55+ if bugtask.pillar.official_malone:
56 return renderElement('i', contents='not assigned')
57 else:
58 return renderElement('i', contents='unknown')
59
60=== modified file 'lib/lp/bugs/configure.zcml'
61--- lib/lp/bugs/configure.zcml 2012-08-16 00:50:36 +0000
62+++ lib/lp/bugs/configure.zcml 2012-08-29 22:21:19 +0000
63@@ -221,7 +221,6 @@
64 asEmailHeaderValue
65 getDelta
66 pillar
67- target_uses_malone
68 bugtask_branches
69 conjoined_master
70 conjoined_slave
71
72=== modified file 'lib/lp/bugs/doc/bugtask-display-widgets.txt'
73--- lib/lp/bugs/doc/bugtask-display-widgets.txt 2011-01-11 11:51:27 +0000
74+++ lib/lp/bugs/doc/bugtask-display-widgets.txt 2012-08-29 22:21:19 +0000
75@@ -52,7 +52,7 @@
76
77 >>> bug_nine = getUtility(IBugSet).get(9)
78 >>> thunderbird_bugtask = bug_nine.bugtasks[0]
79- >>> thunderbird_bugtask.target_uses_malone
80+ >>> thunderbird_bugtask.pillar.official_malone
81 False
82 >>> assignee_field = IBugTask['assignee'].bind(thunderbird_bugtask)
83 >>> assignee_widget = AssigneeDisplayWidget(assignee_field, None, None)
84
85=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
86--- lib/lp/bugs/interfaces/bugtask.py 2012-08-16 04:36:09 +0000
87+++ lib/lp/bugs/interfaces/bugtask.py 2012-08-29 22:21:19 +0000
88@@ -544,8 +544,6 @@
89 title=_('Target'), required=True, schema=Interface, # IBugTarget
90 readonly=True,
91 description=_("The software in which this bug should be fixed.")))
92- target_uses_malone = Bool(
93- title=_("Whether the bugtask's target uses Launchpad officially"))
94 title = exported(
95 Text(title=_("The title of the bug related to this bugtask"),
96 readonly=True))
97
98=== modified file 'lib/lp/bugs/model/bugtask.py'
99--- lib/lp/bugs/model/bugtask.py 2012-08-24 06:28:32 +0000
100+++ lib/lp/bugs/model/bugtask.py 2012-08-29 22:21:19 +0000
101@@ -760,13 +760,6 @@
102 # setter methods directly.
103 setattr(self, synched_attr, PassthroughValue(slave_attr_value))
104
105- @property
106- def target_uses_malone(self):
107- """See `IBugTask`"""
108- # XXX sinzui 2007-10-04 bug=149009:
109- # This property is not needed. Code should inline this implementation.
110- return (self.pillar.bug_tracking_usage == ServiceUsage.LAUNCHPAD)
111-
112 def transitionToMilestone(self, new_milestone, user):
113 """See `IBugTask`."""
114 if not self.userHasBugSupervisorPrivileges(user):
115
116=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
117--- lib/lp/bugs/model/tests/test_bugtask.py 2012-08-28 09:57:40 +0000
118+++ lib/lp/bugs/model/tests/test_bugtask.py 2012-08-29 22:21:19 +0000
119@@ -1194,7 +1194,7 @@
120 """
121 non_malone_using_bugtasks = [
122 related_task for related_task in bugtask.related_tasks
123- if not related_task.target_uses_malone]
124+ if not related_task.pillar.official_malone]
125 pending_bugwatch_bugtasks = [
126 related_bugtask for related_bugtask in non_malone_using_bugtasks
127 if related_bugtask.bugwatch is None]
128
129=== modified file 'lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt'
130--- lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt 2011-12-24 17:49:30 +0000
131+++ lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt 2012-08-29 22:21:19 +0000
132@@ -50,7 +50,7 @@
133
134 >>> bug_two = getUtility(IBugSet).get(2)
135 >>> for bugtask in bug_two.bugtasks:
136- ... if not bugtask.target_uses_malone:
137+ ... if not bugtask.pillar.official_malone:
138 ... bugtask.transitionToStatus(
139 ... BugTaskStatus.INVALID, getUtility(ILaunchBag).user)
140
141
142=== modified file 'lib/lp/bugs/templates/bugtask-edit-form.pt'
143--- lib/lp/bugs/templates/bugtask-edit-form.pt 2012-02-10 07:56:28 +0000
144+++ lib/lp/bugs/templates/bugtask-edit-form.pt 2012-08-29 22:21:19 +0000
145@@ -204,7 +204,7 @@
146 colspan="2" style="white-space: nowrap" />
147 </tr>
148 </table>
149- <table tal:condition="not:context/target_uses_malone">
150+ <table tal:condition="not:context/pillar/official_malone">
151 <tr>
152 <td>
153 <label