Exemplo n.º 1
0
def participant_list_import():
    form = file_upload_form(request.form)

    if not form.validate():
        return abort(400)
    else:
        # get the actual object from the proxy
        user = current_user._get_current_object()
        event = services.events.get_or_404(pk=form.event.data)
        upload = stash_file(request.files['spreadsheet'], user, event)
        upload.save()

        return redirect(
            url_for('participants.participant_headers', pk=unicode(upload.id)))
Exemplo n.º 2
0
def participant_list_import():
    form = file_upload_form(request.form)

    if not form.validate():
        return abort(400)
    else:
        # get the actual object from the proxy
        user = current_user._get_current_object()
        event = services.events.get_or_404(pk=form.event.data)
        upload = stash_file(request.files['spreadsheet'], user, event)
        upload.save()

        return redirect(url_for(
            'participants.participant_headers',
            pk=unicode(upload.id)
        ))
Exemplo n.º 3
0
def locations_import(location_set_id):
    form = file_upload_form(request.form)

    if not form.validate():
        return abort(400)
    else:
        # get the actual object from the proxy
        user = current_user._get_current_object()
        upload_file = utils.strip_bom_header(request.files['spreadsheet'])
        filename = uploads.save(upload_file)
        upload = UserUpload(
            deployment_id=g.deployment.id, upload_filename=filename,
            user_id=user.id)
        upload.save()

        return redirect(url_for('locationset.locations_headers',
                                location_set_id=location_set_id,
                                upload_id=upload.id))