From 75407b92952d4a5fabe9b2d7084fddce5725dcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 22 Dec 2018 09:05:13 +0400 Subject: [PATCH] :rotating_light: Fix mypy type errors --- fastapi/routing.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 964d61ee7..0045f3a79 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -53,14 +53,14 @@ def get_app( if body_field: if is_body_form: raw_body = await request.form() - body = {} + form_fields = {} for field, value in raw_body.items(): if isinstance(value, UploadFile): - body[field] = await value.read() + form_fields[field] = await value.read() else: - body[field] = value - if not body: - body = None + form_fields[field] = value + if form_fields: + body = form_fields else: body_bytes = await request.body() if body_bytes: