diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/tracking.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/tracking.py b/modules/tracking.py index 8083182..f408359 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -552,6 +552,16 @@ url [TRACKINGNO] - Lists URLs for matches to the corresponding website''') # don't add delivered packages if data.delivered: continue + try: + conflicts = session.query(Consignment).join(Consignment.packages) \ + .filter(and_(Package.code == data.code, Consignment.type != consignment.type)).all() + except NoResultFound: + pass + else: + if len(conflicts): + self.irc.msg(target, '%s: %s conflicts with another consignment' % consignment.nick.encode('utf-8'), consignment) + removed = True + break package = Package(consignment.id, data.code) session.add(package) try: |