def csp_update()

in csp/decorators.py [0:0]


def csp_update(config: dict[str, Any] | None = None, REPORT_ONLY: bool = False, **kwargs: Any) -> _VIEW_DECORATOR_T:
    if config is None and kwargs:
        raise RuntimeError(DECORATOR_DEPRECATION_ERROR.format(fname="csp_update"))

    def decorator(f: _VIEW_T) -> _VIEW_T:
        @wraps(f)
        def _wrapped(*a: Any, **kw: Any) -> HttpResponseBase:
            resp = f(*a, **kw)
            if REPORT_ONLY:
                setattr(resp, "_csp_update_ro", config)
            else:
                setattr(resp, "_csp_update", config)
            return resp

        return _wrapped

    return decorator