def get_kobo_params():
    'Collect and validate request parameters and environment variables.'
    kobo_username = getenv('KOBO_USERNAME')
    if (kobo_username is None):
        raise InternalServerError('Missing backend parameter: KOBO_USERNAME')
    kobo_pw = getenv('KOBO_PW')
    if (kobo_pw is None):
        raise InternalServerError('Missing backend parameter: KOBO_PW')
    form_name = request.args.get('formName')
    if (form_name is None):
        raise BadRequest('Missing query parameter: formName')
    datetime_field = request.args.get('datetimeField')
    if (datetime_field is None):
        raise BadRequest('Missing parameter datetimeField')
    geom_field = request.args.get('geomField')
    if (geom_field is None):
        raise BadRequest('Missing parameter: geomField')
    filters = {}
    filters_params = request.args.get('filters', None)
    if (filters_params is not None):
        filters = dict([f.split('=') for f in filters_params.split(',')])
    form_fields = dict(name=form_name, datetime=datetime_field, geom=geom_field, filters=filters)
    auth = (kobo_username, kobo_pw)
    return (auth, form_fields)
Collect and validate request parameters and environment variables.
def get_kobo_params():
    
    kobo_username = getenv('KOBO_USERNAME')
    if (kobo_username is None):
        raise InternalServerError('Missing backend parameter: KOBO_USERNAME')
    kobo_pw = getenv('KOBO_PW')
    if (kobo_pw is None):
        raise InternalServerError('Missing backend parameter: KOBO_PW')
    form_name = request.args.get('formName')
    if (form_name is None):
        raise BadRequest('Missing query parameter: formName')
    datetime_field = request.args.get('datetimeField')
    if (datetime_field is None):
        raise BadRequest('Missing parameter datetimeField')
    geom_field = request.args.get('geomField')
    if (geom_field is None):
        raise BadRequest('Missing parameter: geomField')
    filters = {}
    filters_params = request.args.get('filters', None)
    if (filters_params is not None):
        filters = dict([f.split('=') for f in filters_params.split(',')])
    form_fields = dict(name=form_name, datetime=datetime_field, geom=geom_field, filters=filters)
    auth = (kobo_username, kobo_pw)
    return (auth, form_fields)