🚨 Fix mypy type errors

This commit is contained in:
Sebastián Ramírez 2018-12-22 09:05:13 +04:00
parent 3180f35bdd
commit 75407b9295
1 changed files with 5 additions and 5 deletions

View File

@ -53,14 +53,14 @@ def get_app(
if body_field: if body_field:
if is_body_form: if is_body_form:
raw_body = await request.form() raw_body = await request.form()
body = {} form_fields = {}
for field, value in raw_body.items(): for field, value in raw_body.items():
if isinstance(value, UploadFile): if isinstance(value, UploadFile):
body[field] = await value.read() form_fields[field] = await value.read()
else: else:
body[field] = value form_fields[field] = value
if not body: if form_fields:
body = None body = form_fields
else: else:
body_bytes = await request.body() body_bytes = await request.body()
if body_bytes: if body_bytes: