~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/queue.py

[r=benji][bug=795573,
 796233] On DistroSeries:+localpackagediffs ensure that the comment
 form is hidden after adding a new comment to a DistroSeriesDifference,
 prevent empty comments from being submitted,
 and add some animations and effects to make the UI less jarring and easier to
 follow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    Join,
30
30
    Reference,
31
31
    )
32
 
from storm.store import Store
 
32
from storm.store import (
 
33
    EmptyResultSet,
 
34
    Store,
 
35
    )
33
36
from zope.component import getUtility
34
37
from zope.interface import implements
35
38
 
41
44
    SQLBase,
42
45
    sqlvalues,
43
46
    )
44
 
from canonical.launchpad.interfaces.lpstorm import IMasterStore
 
47
from canonical.launchpad.interfaces.lpstorm import (
 
48
    IMasterStore,
 
49
    IStore,
 
50
    )
45
51
from canonical.librarian.interfaces import DownloadFailed
46
52
from canonical.librarian.utils import copy_and_close
47
53
from lp.app.errors import NotFoundError
478
484
    @property
479
485
    def is_delayed_copy(self):
480
486
        """See `IPackageUpload`."""
481
 
        return self.changesfile is None
 
487
        return self.changesfile is None and self.package_copy_job is None
482
488
 
483
489
    def _isSingleSourceUpload(self):
484
490
        """Return True if this upload contains only a single source."""
533
539
 
534
540
    @cachedproperty
535
541
    def displayname(self):
536
 
        """See `IPackageUpload`"""
 
542
        """See `IPackageUpload`."""
537
543
        names = []
538
544
        for queue_source in self.sources:
539
545
            names.append(queue_source.sourcepackagerelease.name)
1365
1371
        return PackageUploadSource.select("""
1366
1372
            PackageUploadSource.sourcepackagerelease IN %s
1367
1373
            """ % sqlvalues(spr_ids))
 
1374
 
 
1375
    def getByPackageCopyJobIDs(self, pcj_ids):
 
1376
        """See `IPackageUploadSet`."""
 
1377
        if pcj_ids is None or len(pcj_ids) == 0:
 
1378
            return EmptyResultSet()
 
1379
 
 
1380
        return IStore(PackageUpload).find(
 
1381
            PackageUpload,
 
1382
            PackageUpload.package_copy_job_id.is_in(pcj_ids))