]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/queue.py
daklib/queue.py: send mails to sponsors too
[dak.git] / daklib / queue.py
index 165b7088e2c01a4c762d856c1e0e846427f1147b..afd3277840ed153b7972eba59191eb19623b04f6 100755 (executable)
@@ -78,6 +78,7 @@ def get_type(f, session):
     elif re_source_ext.match(f["type"]):
         file_type = "dsc"
     else:
+        file_type = f["type"]
         utils.fubar("invalid type (%s) for new.  Dazed, confused and sure as heck not continuing." % (file_type))
 
     # Validate the override type
@@ -328,8 +329,11 @@ class Upload(object):
             self.Subst["__MAINTAINER_TO__"] = self.pkg.changes["maintainer2047"]
             self.Subst["__MAINTAINER__"] = self.pkg.changes.get("maintainer", "Unknown")
 
-        if "sponsoremail" in self.pkg.changes:
+        session = DBConn().session()
+        fpr = get_fingerprint(self.pkg.changes['fingerprint'], session)
+        if self.check_if_upload_is_sponsored("%s@debian.org" % fpr.uid.uid, fpr.uid.name):
             self.Subst["__MAINTAINER_TO__"] += ", %s" % self.pkg.changes["sponsoremail"]
+        session.close()
 
         if cnf.has_key("Dinstall::TrackingServer") and self.pkg.changes.has_key("source"):
             self.Subst["__MAINTAINER_TO__"] += "\nBcc: %s@%s" % (self.pkg.changes["source"], cnf["Dinstall::TrackingServer"])
@@ -775,7 +779,7 @@ class Upload(object):
         location = cnf["Dir::Pool"]
         l = get_location(location, entry["component"], session=session)
         if l is None:
-            self.rejects.append("[INTERNAL ERROR] couldn't determine location (Component: %)" % entry["component"])
+            self.rejects.append("[INTERNAL ERROR] couldn't determine location (Component: %s)" % entry["component"])
             entry["location id"] = -1
         else:
             entry["location id"] = l.location_id