Pyx ` d Z ddlZddlmZmZ ddlmZ ddlmZ G d dej Z dS )z/ Various suggestions about JSON http responses N)checkers interfaces)utils)BASE_IDc e Zd ZdZej fZdZde ddde ddde dd iZ e j d dd d ZdS )JsonResponseCheckerz` Looks for some common patterns when returning http responses containing JSON data! zjson-response-checkerR01)z@Instead of HttpResponse(json.dumps(data)) use JsonResponse(data)http-response-with-json-dumpsz@Used when json.dumps() is used as an argument to HttpResponse().02)zKInstead of HttpResponse(content_type='application/json') use JsonResponse()$http-response-with-content-type-jsonz7Used when HttpResponse() is returning application/json.03)z3Redundant content_type parameter for JsonResponse()(redundant-content-type-for-json-responsezUsed when JsonResponse() contains content_type parameter. This is either redundant or the content_type is not JSON which is probably an error.r r r c F |j d rk|j rdt |j d t j r?|j d j dk r| d| |j d rw|j rp|j D ]h}|j dk r[|j d dk r| d | ni|j d r6|j r1|j D ]+}|j dk r| d| d S (d S d S d S )NHttpResponser z json.dumpsr )nodecontent_typezapplication/jsonr JsonResponser ) func as_stringendswithargs isinstanceastroidCalladd_messagekeywordsargvaluelowerfind)selfr keywords v/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint_django/checkers/json_response.py visit_callzJsonResponseChecker.visit_call. s I!!**>:: I I 49Q<66 I !!++--==<4HHH9 )).99 dm = ;.00W]5L5L5N5N5T5T5V5V5[5[\n5o5ort5t5t$$%KRV$WWWE9 )).99 dm = ;.00$$%OVZ$[[[EE 1 N) __name__ __module____qualname____doc__r IAstroidChecker__implements__namer msgsr check_messagesr&