def announce_reject(upload, reason, rejected_by=None):
cnf = Config()
subst = _subst_for_upload(upload)
def announce_reject(upload, reason, rejected_by=None):
cnf = Config()
subst = _subst_for_upload(upload)
subst['__BCC__'] = '{0}\nBcc: {1}'.format(subst['__BCC__'], cnf['Dinstall::MyEmailAddress'])
message = TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'queue.rejected'))
subst['__BCC__'] = '{0}\nBcc: {1}'.format(subst['__BCC__'], cnf['Dinstall::MyEmailAddress'])
message = TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'queue.rejected'))
subst['__SUITE__'] = ', '.join(suite_names) or '(none)'
message = TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.accepted'))
subst['__SUITE__'] = ', '.join(suite_names) or '(none)'
message = TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.accepted'))
if len(announce_list_address) != 0:
my_subst = subst.copy()
my_subst['__ANNOUNCE_LIST_ADDRESS__'] = announce_list_address
message = TemplateSubst(my_subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.announce'))
if len(announce_list_address) != 0:
my_subst = subst.copy()
my_subst['__ANNOUNCE_LIST_ADDRESS__'] = announce_list_address
message = TemplateSubst(my_subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.announce'))
- if accepted_to_real_suite and upload.sourceful and cnf.find_b('Dinstall::CloseBugs'):
+ close_bugs_default = cnf.find_b('Dinstall::CloseBugs')
+ close_bugs = any(s.close_bugs if s.close_bugs is not None else close_bugs_default for s in upload.suites)
+ if accepted_to_real_suite and upload.sourceful and close_bugs:
- message = TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.bug-close'))
- send_mail(message)
+ message = TemplateSubst(my_subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.bug-close'))
+ send_mail(message, whitelists=whitelists)