Skip to content

Commit

Permalink
variable type corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitsharansatsangi committed Aug 17, 2022
1 parent 51b5453 commit 98ffdf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion piccolo_api/media/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def store_file_sync(
file_key = self.generate_file_key(file_name=file_name, user=user)
extension = file_key.rsplit(".", 1)[-1]
client = self.get_client()
metadata = {'ACL': self.default_acl, 'ContentDisposition': 'inline'}
metadata: t.Dict[str, t.Any] = {'ACL': self.default_acl, 'ContentDisposition': 'inline'}
if extension in CONTENT_TYPE:
metadata['ContentType'] = CONTENT_TYPE[extension]
if self.cache_max_age:
Expand Down
4 changes: 2 additions & 2 deletions piccolo_api/shared/middleware/junction.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ def __init__(self, *routers: Router) -> None:
async def __call__(self, scope: Scope, receive: Receive, send: Send):
for router in self.routers:
try:
response: t.Any | None = await router(
asgi = await router(
scope, receive=receive, send=send
)
except HTTPException as exception:
if exception.status_code != 404:
raise exception
else:
if getattr(response, "status_code", None) == 404:
if getattr(asgi, "status_code", None) == 404:
continue
return

Expand Down

0 comments on commit 98ffdf5

Please sign in to comment.