Beispiel #1
0
def send_reminder():
    """ Retrieve all the meeting for which we should send a reminder and
    do it.
    """
    db_url = fedocal.APP.config['DB_URL']
    session = fedocallib.create_session(db_url)
    meetings = fedocallib.retrieve_meeting_to_remind(session,
        offset=int(fedocal.APP.config['CRON_FREQUENCY']))
    for meeting in meetings:
        send_reminder_meeting(meeting)
Beispiel #2
0
def send_reminder():
    """ Retrieve all the meeting for which we should send a reminder and
    do it.
    """
    db_url = fedocal.APP.config['DB_URL']
    session = fedocallib.create_session(db_url)
    meetings = fedocallib.retrieve_meeting_to_remind(
        session, offset=int(fedocal.APP.config['CRON_FREQUENCY']))
    for meeting in meetings:
        meeting_id = meeting.meeting_id
        meeting = fedocallib.update_date_rec_meeting(meeting, action='next')
        send_reminder_meeting(meeting, meeting_id)
        fedmsg_publish(meeting)
Beispiel #3
0
def send_reminder():
    """ Retrieve all the meeting for which we should send a reminder and
    do it.
    """
    db_url = fedocal.APP.config['DB_URL']
    session = fedocallib.create_session(db_url)
    meetings = fedocallib.retrieve_meeting_to_remind(
        session, offset=int(fedocal.APP.config['CRON_FREQUENCY']))

    msgs = []
    for meeting in meetings:
        meeting_id = meeting.meeting_id
        meeting = fedocallib.update_date_rec_meeting(meeting, action='next')
        msgs.append(send_reminder_meeting(meeting, meeting_id))
        fedmsg_publish(meeting, meeting_id)

    return msgs
Beispiel #4
0
import forms as forms
import fedocal.fedocallib as fedocallib
import fedocallib.dbaction
from fedocal.fedocallib.exceptions import FedocalException
from fedocal.fedocallib.model import Calendar, Meeting

# Create the application.
APP = flask.Flask(__name__)
# set up FAS
APP.config.from_object("fedocal.default_config")

if "FEDOCAL_CONFIG" in os.environ:
    APP.config.from_envvar("FEDOCAL_CONFIG")

FAS = FAS(APP)
SESSION = fedocallib.create_session(APP.config["DB_URL"])


import fedocal.api


def cla_plus_one_required(function):
    """ Flask decorator to retrict access to CLA+1.
To use this decorator you need to have a function named 'auth_login'.
Without that function the redirect if the user is not logged in will not
work.
"""

    @wraps(function)
    def decorated_function(*args, **kwargs):
        valid = True
Beispiel #5
0
# Create the application.
APP = flask.Flask(__name__)
# set up FAS
APP.config.from_object('fedocal.default_config')

if 'FEDOCAL_CONFIG' in os.environ:
    APP.config.from_envvar('FEDOCAL_CONFIG')

# Points the template and static folders to the desired theme
APP.template_folder = os.path.join(
    APP.template_folder, APP.config['THEME_FOLDER'])
APP.static_folder = os.path.join(
    APP.static_folder, APP.config['THEME_FOLDER'])

FAS = FAS(APP)
SESSION = fedocallib.create_session(APP.config['DB_URL'])


import fedocal.api


def cla_plus_one_required(function):
    """ Flask decorator to retrict access to CLA+1.
To use this decorator you need to have a function named 'auth_login'.
Without that function the redirect if the user is not logged in will not
work.
"""
    @wraps(function)
    def decorated_function(*args, **kwargs):
        if flask.g.fas_user is None:
            flask.flash('Login required', 'errors')