Exemplo n.º 1
0
def _submission_response(context, instance):
    context.message = _("Successful submission.")
    context.formid = instance.xform.id_string
    context.encrypted = instance.xform.encrypted
    context.instanceID = u'uuid:%s' % instance.uuid
    context.submissionDate = instance.date_created.isoformat()
    context.markedAsCompleteDate = instance.date_modified.isoformat()
    t = loader.get_template('submission.xml')

    return BaseOpenRosaResponse(t.render(context))
Exemplo n.º 2
0
def _submission_response(instance):
    data = {}
    data['message'] = _("Successful submission.")
    data['formid'] = instance.xform.id_string
    data['encrypted'] = instance.xform.encrypted
    data['instanceID'] = u'uuid:%s' % instance.uuid
    data['submissionDate'] = instance.date_created.isoformat()
    data['markedAsCompleteDate'] = instance.date_modified.isoformat()

    return BaseOpenRosaResponse(
        loader.get_template('submission.xml').render(data))
Exemplo n.º 3
0
def _submission_response(request, instance):
    data = {
        'message': t("Successful submission."),
        'formid': instance.xform.id_string,
        'encrypted': instance.xform.encrypted,
        'instanceID': f'uuid:{instance.uuid}',
        'submissionDate': instance.date_created.isoformat(),
        'markedAsCompleteDate': instance.date_modified.isoformat()
    }

    t = loader.get_template('submission.xml')

    return BaseOpenRosaResponse(t.render(data, request=request))