1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #33476 -- Reformatted code with Black.

This commit is contained in:
django-bot
2022-02-03 20:24:19 +01:00
committed by Mariusz Felisiak
parent f68fa8b45d
commit 9c19aff7c7
1992 changed files with 139577 additions and 96284 deletions

View File

@@ -5,16 +5,18 @@ from django.template.response import TemplateResponse
def normal_view(request):
return HttpResponse('OK')
return HttpResponse("OK")
def template_response(request):
template = engines['django'].from_string('template_response OK{% for m in mw %}\n{{ m }}{% endfor %}')
return TemplateResponse(request, template, context={'mw': []})
template = engines["django"].from_string(
"template_response OK{% for m in mw %}\n{{ m }}{% endfor %}"
)
return TemplateResponse(request, template, context={"mw": []})
def server_error(request):
raise Exception('Error in view')
raise Exception("Error in view")
def permission_denied(request):
@@ -24,14 +26,14 @@ def permission_denied(request):
def exception_in_render(request):
class CustomHttpResponse(HttpResponse):
def render(self):
raise Exception('Exception in HttpResponse.render()')
raise Exception("Exception in HttpResponse.render()")
return CustomHttpResponse('Error')
return CustomHttpResponse("Error")
async def async_exception_in_render(request):
class CustomHttpResponse(HttpResponse):
async def render(self):
raise Exception('Exception in HttpResponse.render()')
raise Exception("Exception in HttpResponse.render()")
return CustomHttpResponse('Error')
return CustomHttpResponse("Error")