Esempio n. 1
0
    def __init__(self, conf):
        when = [days_before(10, conf.deadline)]
        if conf.email_post_con:
            when.append(after(c.EPOCH))

        AutomatedEmailFixture.__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=when,
            sender=c.STAFF_EMAIL,
            extra_data={'conf': conf},
            allow_post_con=conf.email_post_con)
Esempio n. 2
0
    def __init__(self, conf):
        when = [days_before(10, conf.deadline)]
        if conf.email_post_con:
            when.append(after(c.EPOCH))

        AutomatedEmailFixture.__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=when,
            sender=c.STAFF_EMAIL,
            extra_data={'conf': conf},
            allow_post_con=conf.email_post_con)
Esempio n. 3
0
    #     Group.registered < (func.now() - timedelta(days=30))),
    when=before(c.GROUP_PREREG_TAKEDOWN),
    needs_approval=False,
    ident='group_preassign_badges_reminder',
    sender=c.REGDESK_EMAIL)

AutomatedEmailFixture(
    Group,
    'Last chance to pre-assign {EVENT_NAME} group badges',
    'reg_workflow/group_preassign_reminder.txt',
    lambda g: (c.AFTER_GROUP_PREREG_TAKEDOWN and g.unregistered_badges and
               (not g.is_dealer or g.status == c.APPROVED)),
    # query=and_(
    #     Group.unregistered_badges == True,
    #     or_(Group.is_dealer == False, Group.status == c.APPROVED)),
    when=after(c.GROUP_PREREG_TAKEDOWN),
    needs_approval=False,
    allow_at_the_con=True,
    ident='group_preassign_badges_reminder_last_chance',
    sender=c.REGDESK_EMAIL)

# =============================
# art show
# =============================
AutomatedEmailFixture.queries.update({
    ArtShowApplication:
    lambda session: session.query(ArtShowApplication).options(
        subqueryload(ArtShowApplication.attendee))
})

Esempio n. 4
0
from uber.automated_emails import AutomatedEmailFixture
from uber.config import c
from uber.models import Attendee, AutomatedEmail, Session
from uber.utils import after, before

NOW = datetime(year=2016, month=8, day=10, hour=12, tzinfo=c.EVENT_TIMEZONE)
TWO_DAYS_FROM_NOW = NOW + timedelta(days=2)
TOMORROW = NOW + timedelta(days=1)
YESTERDAY = NOW - timedelta(days=1)
TWO_DAYS_AGO = NOW - timedelta(days=2)

ACTIVE_WHEN = [
    # ==== ACTIVE ====
    [],  # Always active
    [before(TOMORROW)],  # Will expire tomorrow
    [after(YESTERDAY)],  # Became active yesterday
    [after(YESTERDAY),
     before(TOMORROW)],  # Became active yesterday, will expire tomorrow

    # ==== INACTIVE BUT APPROVABLE ====
    [after(TOMORROW)],  # Will become active tomorrow
    [after(TOMORROW), before(TWO_DAYS_FROM_NOW)
     ],  # Will become active tomorrow, will expire in 2 days

    # ==== INACTIVE ====
    [before(YESTERDAY)],  # Expired yesterday
    [after(TWO_DAYS_AGO),
     before(YESTERDAY)],  # Became active 2 days ago, expired yesterday
]

ACTIVE_WHEN_LABELS = [
Esempio n. 5
0
    #     Group.registered < (func.now() - timedelta(days=30))),
    when=before(c.GROUP_PREREG_TAKEDOWN),
    needs_approval=False,
    ident='group_preassign_badges_reminder',
    sender=c.REGDESK_EMAIL)

AutomatedEmailFixture(
    Group,
    'Last chance to pre-assign {EVENT_NAME} group badges',
    'reg_workflow/group_preassign_reminder.txt',
    lambda g: (c.AFTER_GROUP_PREREG_TAKEDOWN and g.unregistered_badges and
               (not g.is_dealer or g.status == c.APPROVED)),
    # query=and_(
    #     Group.unregistered_badges == True,
    #     or_(Group.is_dealer == False, Group.status == c.APPROVED)),
    when=after(c.GROUP_PREREG_TAKEDOWN),
    needs_approval=False,
    ident='group_preassign_badges_reminder_last_chance',
    sender=c.REGDESK_EMAIL)

# Dealer emails; these are safe to be turned on for all events because even if the event doesn't have dealers,
# none of these emails will be sent unless someone has applied to be a dealer, which they cannot do until
# dealer registration has been turned on.


class MarketplaceEmailFixture(AutomatedEmailFixture):
    def __init__(self, subject, template, filter, ident, **kwargs):
        AutomatedEmailFixture.__init__(
            self,
            Group,
            subject,
Esempio n. 6
0
    lambda a: a.status == c.DECLINED,
    ident='art_show_declined')

ArtShowAppEmailFixture(
    'Reminder to pay for your {EVENT_NAME} Art Show application',
    'art_show/payment_reminder.txt',
    lambda a: a.status == c.APPROVED and a.is_unpaid,
    when=days_before(14, c.ART_SHOW_PAYMENT_DUE),
    ident='art_show_payment_reminder')

ArtShowAppEmailFixture(
    '{EVENT_NAME} Art Show piece entry needed',
    'art_show/pieces_reminder.txt',
    lambda a: a.status == c.PAID and not a.art_show_pieces,
    when=days_before(15, c.EPOCH),
    ident='art_show_pieces_reminder')

ArtShowAppEmailFixture(
    'Reminder to assign an agent for your {EVENT_NAME} Art Show application',
    'art_show/agent_reminder.html',
    lambda a: a.status == c.PAID and not a.agent,
    when=after(c.EVENT_TIMEZONE.localize(datetime(int(c.EVENT_YEAR), 11, 1))),
    ident='art_show_agent_reminder')

ArtShowAppEmailFixture(
    '{EVENT_NAME} Art Show MAIL IN Instructions',
    'art_show/mailing_in.html',
    lambda a: a.status == c.PAID and a.delivery_method == c.BY_MAIL,
    when=days_before(40, c.ART_SHOW_DEADLINE),
    ident='art_show_mail_in')
Esempio n. 7
0
    needs_approval=False,
    ident='group_preassign_badges_reminder',
    sender=c.REGDESK_EMAIL)

AutomatedEmailFixture(
    Group,
    'Last chance to pre-assign {EVENT_NAME} group badges',
    'reg_workflow/group_preassign_reminder.txt',
    lambda g: (
      c.AFTER_GROUP_PREREG_TAKEDOWN
      and g.unregistered_badges
      and (not g.is_dealer or g.status == c.APPROVED)),
    # query=and_(
    #     Group.unregistered_badges == True,
    #     or_(Group.is_dealer == False, Group.status == c.APPROVED)),
    when=after(c.GROUP_PREREG_TAKEDOWN),
    needs_approval=False,
    ident='group_preassign_badges_reminder_last_chance',
    sender=c.REGDESK_EMAIL)


# Dealer emails; these are safe to be turned on for all events because even if the event doesn't have dealers,
# none of these emails will be sent unless someone has applied to be a dealer, which they cannot do until
# dealer registration has been turned on.

class MarketplaceEmailFixture(AutomatedEmailFixture):
    def __init__(self, subject, template, filter, ident, **kwargs):
        AutomatedEmailFixture.__init__(
            self,
            Group,
            subject,
Esempio n. 8
0
from uber.config import c
from uber.models import Attendee, AutomatedEmail, Session
from uber.utils import after, before


NOW = c.EVENT_TIMEZONE.localize(datetime(year=2016, month=8, day=10, hour=12, tzinfo=None))
TWO_DAYS_FROM_NOW = NOW + timedelta(days=2)
TOMORROW = NOW + timedelta(days=1)
YESTERDAY = NOW - timedelta(days=1)
TWO_DAYS_AGO = NOW - timedelta(days=2)

ACTIVE_WHEN = [
    # ==== ACTIVE ====
    [],  # Always active
    [before(TOMORROW)],  # Will expire tomorrow
    [after(YESTERDAY)],  # Became active yesterday
    [after(YESTERDAY), before(TOMORROW)],  # Became active yesterday, will expire tomorrow

    # ==== INACTIVE BUT APPROVABLE ====
    [after(TOMORROW)],  # Will become active tomorrow
    [after(TOMORROW), before(TWO_DAYS_FROM_NOW)],  # Will become active tomorrow, will expire in 2 days

    # ==== INACTIVE ====
    [before(YESTERDAY)],  # Expired yesterday
    [after(TWO_DAYS_AGO), before(YESTERDAY)],  # Became active 2 days ago, expired yesterday
]

ACTIVE_WHEN_LABELS = [
    '',
    'before Aug 11',
    'after Aug 9',
    #     Group.registered < (func.now() - timedelta(days=30))),
    when=before(c.GROUP_PREREG_TAKEDOWN),
    needs_approval=False,
    ident='group_preassign_badges_reminder',
    sender=c.REGDESK_EMAIL)

AutomatedEmailFixture(
    Group,
    'Last chance to pre-assign {EVENT_NAME} group badges',
    'reg_workflow/group_preassign_reminder.txt',
    lambda g: (c.AFTER_GROUP_PREREG_TAKEDOWN and g.unregistered_badges and
               (not g.is_dealer or g.status == c.APPROVED)),
    # query=and_(
    #     Group.unregistered_badges == True,
    #     or_(Group.is_dealer == False, Group.status == c.APPROVED)),
    when=after(c.GROUP_PREREG_TAKEDOWN),
    needs_approval=False,
    allow_at_the_con=True,
    ident='group_preassign_badges_reminder_last_chance',
    sender=c.REGDESK_EMAIL)

# Dealer emails; these are safe to be turned on for all events because even if the event doesn't have dealers,
# none of these emails will be sent unless someone has applied to be a dealer, which they cannot do until
# dealer registration has been turned on.


class MarketplaceEmailFixture(AutomatedEmailFixture):
    def __init__(self, subject, template, filter, ident, **kwargs):
        AutomatedEmailFixture.__init__(
            self,
            Group,