def __init__(self, subject, template, filter, ident, **kwargs): AutomatedEmail.__init__(self, GuestGroup, subject, template, lambda b: b.group_type == c.GUEST and filter(b), ident, sender=c.GUEST_EMAIL, **kwargs)
def __init__(self, subject, template, filter, ident, **kwargs): AutomatedEmail.__init__(self, Group, subject, template, lambda g: g.is_dealer and filter(g), ident, sender=c.MARKETPLACE_EMAIL, **kwargs)
def __init__(self, subject, template, filter, ident, **kwargs): AutomatedEmail.__init__(self, Attendee, subject, template, lambda a: a.staffing and filter(a), ident, sender=c.STAFF_EMAIL, **kwargs)
def __init__(self, subject, template, filter, ident, **kwargs): AutomatedEmail.__init__(self, PanelApplication, subject, template, lambda app: filter(app) and ( not app.submitter or not app.submitter.attendee_id or app.submitter.attendee.badge_type != c.GUEST_BADGE), ident, sender=c.PANELS_EMAIL, **kwargs)
def __init__(self, conf): AutomatedEmail.__init__(self, Attendee, '{EVENT_NAME} Department Checklist: ' + conf.name, 'shifts/dept_checklist.txt', filter=lambda a: a.admin_account and any( not d.checklist_item_for_slug(conf.slug) for d in a.checklist_admin_depts), ident='department_checklist_{}'.format(conf.name), when=days_before(10, conf.deadline), sender=c.STAFF_EMAIL, extra_data={'conf': conf}, post_con=conf.email_post_con or False)
def add_test_email_categories(remove_all_email_categories): AutomatedEmail( model=Attendee, subject='{EVENT_NAME}: You Need To Know', ident='you_are_not_him', template='unrest_in_the_house_of_light.html', filter=lambda a: a.paid == c.NEED_NOT_PAY, when=(), sender="*****@*****.**", extra_data=None, cc="*****@*****.**", bcc=None, post_con=False, needs_approval=True, )
def __init__(self, *args, **kwargs): kwargs.setdefault('sender', c.MITS_EMAIL) AutomatedEmail.__init__(self, MITSTeam, *args, **kwargs)
def __init__(self, *args, **kwargs): if len(args) < 4 and 'filter' not in kwargs: kwargs['filter'] = lambda x: True AutomatedEmail.__init__(self, *args, sender=c.MIVS_EMAIL, **kwargs)
from pytz import UTC from uber.automated_emails_server import AutomatedEmail from uber.config import c from uber.models import Attendee, Group, GuestGroup, IndieGame, IndieJudge, IndieStudio, MITSTeam, \ PanelApplication, Room from uber.utils import before, days_after, days_before, localized_now, DeptChecklistConf # Payment reminder emails, including ones for groups, which are always safe to be here, since they just # won't get sent if group registration is turned off. AutomatedEmail(Attendee, '{EVENT_NAME} payment received', 'reg_workflow/attendee_confirmation.html', lambda a: a.paid == c.HAS_PAID, needs_approval=False, allow_during_con=True, ident='attendee_payment_received') AutomatedEmail(Attendee, '{EVENT_NAME} registration confirmed', 'reg_workflow/attendee_confirmation.html', lambda a: a.paid == c.NEED_NOT_PAY and (a.confirmed or a.promo_code_id), needs_approval=False, allow_during_con=True, ident='attendee_badge_confirmed') AutomatedEmail(Group, '{EVENT_NAME} group payment received', 'reg_workflow/group_confirmation.html', lambda g: g.amount_paid == g.cost and g.cost != 0 and g.leader_id, needs_approval=False, ident='group_payment_received')
def test_empty_ident_arg(self): with pytest.raises(AssertionError): AutomatedEmail(Attendee, '', '', lambda a: False, ident='') with pytest.raises(AssertionError): AutomatedEmail(Attendee, '', '', lambda a: False, ident=None)
def test_missing_ident_arg(self): with pytest.raises(TypeError): AutomatedEmail(Attendee, '', '', lambda a: False)
def test_no_filter(self): # this is slightly silly but, if this ever changes, we should be explicit about what the expected result is with pytest.raises(TypeError): AutomatedEmail(Attendee, '', '', ident='test_no_filter')
def test_none_filter(self): with pytest.raises(AssertionError): AutomatedEmail(Attendee, '', '', None, ident='test_none_filter')