def _inject_query_params(args, kwargs):
    """When a view method that takes parameters mapped from the query
    string is decorated, the parameters are lost when the decorated method
    is called. This function tries to access the request and returns a new
    kwargs dictionary that contains the arguments from the query
    string.
    """
    try:
        instance = args[0]
        kw = kwargs.copy()
        kw.update(instance.request.form)
        return kw
    except (AttributeError, IndexError):
        return kwargs
