Factor generic code out of import validation.

Bug #300608 reported by Henning Eggers
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

The TranslationImportQueueEntryView contains a private method _checkProductOrPackage that is generic in that it checks if an object is linked to the same productseries or distroseries/sourcepackage as the provided context, or even more general, another object. This is also used in TranslationTemplateVocabulary and may even be found in other places. It schould be factored out of the view.

Celso Providelo suggested to this at database level:
> I wonder if now with Storm clause syntax we could find a way to have a
> single collection of clauses that could be used in both, python domain
> and Storm.
>
> But nevermind, it's probably a bluesky idea ...

BjormT suggested:
<BjornT> henninge: re your question about where to put the code. without knowing more about where that piece of code is supposed to be used, i'd suggest that your ojbects should have a 'target' property, which is either the productseries or distoseriessourcepackage
<BjornT> henninge: then you would simply do context.target == another_context.target

Changed in rosetta:
importance: Undecided → Medium
status: New → Triaged
Curtis Hovey (sinzui)
tags: added: tech-debt
Curtis Hovey (sinzui)
Changed in launchpad:
importance: Medium → Low
tags: added: rosetta-imports
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.