launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #10635
Re: [Merge] lp:~stevenk/launchpad/destroy-ihasbugs-bugtasks into lp:launchpad
Review: Approve code
261 - store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
262 target_clause = self._getOfficialTagClause()
263 - return list(store.find(
264 + return list(IMasterStore(OfficialBugTag).find(
265 OfficialBugTag.tag, target_clause).order_by(OfficialBugTag.tag))
That should be IStore, not IMasterStore.
272 - store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
273 target_clause = self._getOfficialTagClause()
274 - return store.find(
275 + return IMasterStore(OfficialBugTag).find(
276 OfficialBugTag, OfficialBugTag.tag == tag, target_clause).one()
Likewise.
283 - store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
284 tag = self._getTag(tag)
285 if tag is not None:
286 - store.remove(tag)
287 + IMasterStore(OfficialBugTag).remove(tag)
Here too.
310 + @cachedproperty
311 + def new_bugtasks_count(self):
Is it perhaps worth having a test for this?
314 + search_params.setSourcePackage(self.context)
315 + return self.context.searchTasks(search_params).count()
BugTarget.searchTasks already sets the target (in _customizeSearchParams).
367 - self.assertEqual(0, product.development_focus.all_bugtasks.count())
368 + search = BugTaskSearchParams(user=None, omit_dupes=True)
369 + search.setTarget(product.development_focus)
370 + tasks = product.development_focus.searchTasks(search)
371 + self.assertEqual(0, tasks.count())
As above, the target is already set, and you don't really care about omit_dupes. Just do a product.development_focus.searchTasks(BugTaskSearchParams(user=None)).
--
https://code.launchpad.net/~stevenk/launchpad/destroy-ihasbugs-bugtasks/+merge/118439
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
References