def start_work_applicant_expired(interest, bounty): from_email = settings.CONTACT_EMAIL to_email = bounty.bounty_owner_email if not to_email: if bounty.bounty_owner_profile: to_email = bounty.bounty_owner_profile.email if not to_email: if bounty.bounty_owner_profile and bounty.bounty_owner_profile.user: to_email = bounty.bounty_owner_profile.user.email if not to_email: return cur_language = translation.get_language() try: setup_lang(to_email) html, text, subject = render_start_work_applicant_expired( interest, bounty) if not should_suppress_notification_email(to_email, 'bounty'): send_mail(from_email, to_email, subject, text, html, categories=['transactional', func_name()]) finally: translation.activate(cur_language)
def start_work_applicant_expired(interest, bounty): from_email = settings.CONTACT_EMAIL to_email = bounty.bounty_owner_email cur_language = translation.get_language() try: setup_lang(to_email) html, text, subject = render_start_work_applicant_expired(interest, bounty) if not should_suppress_notification_email(to_email, 'bounty'): send_mail(from_email, to_email, subject, text, html) finally: translation.activate(cur_language)