コード例 #1
0
def download_contact_list(service_id, contact_list_id):
    contact_list = ContactList.from_id(contact_list_id, service_id=service_id)
    return send_file(
        filename_or_fp=BytesIO(contact_list.contents.encode('utf-8')),
        attachment_filename=contact_list.saved_file_name,
        as_attachment=True,
    )
コード例 #2
0
def contact_list(service_id, contact_list_id):
    contact_list = ContactList.from_id(contact_list_id, service_id=service_id)
    return render_template(
        'views/uploads/contact-list/contact-list.html',
        contact_list=contact_list,
        jobs=contact_list.get_jobs(
            page=1,
            limit_days=current_service.get_days_of_retention(
                contact_list.template_type),
        ),
    )
コード例 #3
0
def send_from_contact_list(service_id, template_id, contact_list_id):
    contact_list = ContactList.from_id(
        contact_list_id,
        service_id=current_service.id,
    )
    return redirect(url_for(
        'main.check_messages',
        service_id=current_service.id,
        template_id=template_id,
        upload_id=contact_list.copy_to_uploads(),
        contact_list_id=contact_list.id,
    ))
コード例 #4
0
def delete_contact_list(service_id, contact_list_id):
    contact_list = ContactList.from_id(contact_list_id, service_id=service_id)

    if request.method == 'POST':
        contact_list.delete()
        return redirect(url_for(
            '.uploads',
            service_id=service_id,
        ))

    flash([
        f"Are you sure you want to delete ‘{contact_list.original_file_name}’?",
    ], 'delete')

    return render_template(
        'views/uploads/contact-list/contact-list.html',
        contact_list=contact_list,
        confirm_delete_banner=True,
    )
コード例 #5
0
ファイル: uploads.py プロジェクト: sfount/notifications-admin
def contact_list(service_id, contact_list_id):
    return render_template(
        'views/uploads/contact-list/contact-list.html',
        contact_list=ContactList.from_id(contact_list_id,
                                         service_id=service_id),
    )