Пример #1
0
def organizations_dashboard():
    form = SendTextForm()
    form.location.choices = Location.get_choices()

    if request.method == 'POST':
        form.process(request.form)

        if form.validate():
            send_text_messages(get_sms_data_from_form(form))
            flash('Your message was successfully sent!')

    return render_template('organizations/dashboard.html',
                           form = form)
Пример #2
0
def recipients_sign_up():
    form = SignUpRecipientForm()
    form.location.choices = Location.get_choices()

    if request.method == 'POST':
        form.process(request.form)
        if form.validate():
            recipient = Recipient.new(
                form.phone_number.data,
                form.location.data
            )
            recipient.save()

    return render_template('recipients/sign-up.html',
                           form = form)