Beispiel #1
0
def get_active_call_to_action():
    """Return the active call to action."""
    now = arrow.utcnow().to(current_app.config['TIME_ZONE']).naive

    return CallToAction.query.current.filter(
        CallToAction.active == True,  # NOQA
        CallToAction.begins < now,
        db.or_(CallToAction.ends > now, CallToAction.ends == None),
    ).order_by(CallToAction.begins, db.desc(CallToAction.ends)).first()
Beispiel #2
0
def get_active_call_to_action():
    """Return the active call to action."""
    now = arrow.utcnow().to('America/New_York').naive

    return CallToAction.query.current.filter(
        CallToAction.active == True,  # NOQA
        CallToAction.begins < now,
        db.or_(CallToAction.ends > now, CallToAction.ends == None),
    ).order_by(CallToAction.begins, db.desc(CallToAction.ends)).first()
Beispiel #3
0
def get_active_announcements():
    """Get the active announcements."""
    now = arrow.utcnow().to(current_app.config['TIME_ZONE']).naive

    # TODO: Possibly display old announcements if the current event has none.
    return Announcement.query.current.filter(
        Announcement.active == True,  # NOQA
        Announcement.published < now,
    ).order_by(db.desc(Announcement.published)).all()
Beispiel #4
0
def get_active_announcements():
    """Get the active announcements."""
    now = arrow.utcnow().to('America/New_York').naive

    # TODO: Possibly display old announcements if the current event has none.
    return Announcement.query.current.filter(
        Announcement.active == True,
        Announcement.published < now,
    ).order_by(db.desc(Announcement.published)).all()