(request, domain)
return {
        'since': request.GET.get('since'),
        'version': request.GET.get('version', "2.0"),
        'state': request.GET.get('state'),
        'items': request.GET.get('items') == 'true',
        'as_user': request.GET.get('as'),
        'overwrite_cache': request.GET.get('overwrite_cache') == 'true',
        'openrosa_version': openrosa_version,
        'device_id': request.GET.get('device_id'),
        'user_id': request.GET.get('user_id'),
        'skip_fixtures': skip_fixtures,
        'auth_type': getattr(request, 'auth_type', None),
    }
Given a request, get the relevant restore parameters out with sensible defaults
Given a request, get the relevant restore parameters out with sensible defaults
Given a request get the relevant restore parameters out with sensible defaults
def get_restore_params(request, domain):
    """
    Given a request, get the relevant restore parameters out with sensible defaults
    """
    # not a view just a view util
    try:
        openrosa_headers = getattr(request, 'openrosa_headers', {})
        openrosa_version = openrosa_headers[OPENROSA_VERSION_HEADER]
    except KeyError:
        openrosa_version = request.GET.get('openrosa_version', None)
    if isinstance(openrosa_version, bytes):
        openrosa_version = openrosa_version.decode('utf-8')

    skip_fixtures = (
        toggles.SKIP_FIXTURES_ON_RESTORE.enabled(
            domain, namespace=toggles.NAMESPACE_DOMAIN
        ) or request.GET.get('skip_fixtures') == 'true'
    )

    return {
        'since': request.GET.get('since'),
        'version': request.GET.get('version', "2.0"),
        'state': request.GET.get('state'),
        'items': request.GET.get('items') == 'true',
        'as_user': request.GET.get('as'),
        'overwrite_cache': request.GET.get('overwrite_cache') == 'true',
        'openrosa_version': openrosa_version,
        'device_id': request.GET.get('device_id'),
        'user_id': request.GET.get('user_id'),
        'skip_fixtures': skip_fixtures,
        'auth_type': getattr(request, 'auth_type', None),
    }
def get_restore_params ( request , domain ) : # not a view just a view util try : openrosa_headers = getattr ( request , 'openrosa_headers' , { } ) openrosa_version = openrosa_headers [ OPENROSA_VERSION_HEADER ] except KeyError : openrosa_version = request . GET . get ( 'openrosa_version' , None ) if isinstance ( openrosa_version , bytes ) : openrosa_version = openrosa_version . decode ( 'utf-8' ) skip_fixtures = ( toggles . SKIP_FIXTURES_ON_RESTORE . enabled ( domain , namespace = toggles . NAMESPACE_DOMAIN ) or request . GET . get ( 'skip_fixtures' ) == 'true' ) return { 'since' : request . GET . get ( 'since' ) , 'version' : request . GET . get ( 'version' , "2.0" ) , 'state' : request . GET . get ( 'state' ) , 'items' : request . GET . get ( 'items' ) == 'true' , 'as_user' : request . GET . get ( 'as' ) , 'overwrite_cache' : request . GET . get ( 'overwrite_cache' ) == 'true' , 'openrosa_version' : openrosa_version , 'device_id' : request . GET . get ( 'device_id' ) , 'user_id' : request . GET . get ( 'user_id' ) , 'skip_fixtures' : skip_fixtures , 'auth_type' : getattr ( request , 'auth_type' , None ) , }