]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🚨 Fix black linting (#682)
authorFrançois Voron <fvoron@gmail.com>
Sat, 23 Nov 2019 21:43:43 +0000 (22:43 +0100)
committerSebastián Ramírez <tiangolo@gmail.com>
Sat, 23 Nov 2019 21:43:43 +0000 (22:43 +0100)
fastapi/dependencies/utils.py
fastapi/openapi/utils.py
tests/test_security_http_base_optional.py
tests/test_security_http_bearer_optional.py
tests/test_security_http_digest_optional.py

index 437b3184af68bbca5313d8d8b332c265bade50c3..4745f173f0d6e628e4b9f1eb1db6da09de99fff5 100644 (file)
@@ -428,9 +428,13 @@ async def solve_dependencies(
             dependency_overrides_provider=dependency_overrides_provider,
             dependency_cache=dependency_cache,
         )
-        sub_values, sub_errors, background_tasks, sub_response, sub_dependency_cache = (
-            solved_result
-        )
+        (
+            sub_values,
+            sub_errors,
+            background_tasks,
+            sub_response,
+            sub_dependency_cache,
+        ) = solved_result
         sub_response = cast(Response, sub_response)
         response.headers.raw.extend(sub_response.headers.raw)
         if sub_response.status_code:
@@ -476,7 +480,10 @@ async def solve_dependencies(
     values.update(cookie_values)
     errors += path_errors + query_errors + header_errors + cookie_errors
     if dependant.body_params:
-        body_values, body_errors = await request_body_to_args(  # body_params checked above
+        (
+            body_values,
+            body_errors,
+        ) = await request_body_to_args(  # body_params checked above
             required_params=dependant.body_params, received_body=body
         )
         values.update(body_values)
index 89954f5b188016a707712dc7c0e16ee2d69ca50c..2d6e38ee059352e45e85d4dc56906cdf65d1c07b 100644 (file)
@@ -79,7 +79,7 @@ def get_openapi_security_definitions(flat_dependant: Dependant) -> Tuple[Dict, L
 
 
 def get_openapi_operation_parameters(
-    all_route_params: Sequence[Field]
+    all_route_params: Sequence[Field],
 ) -> List[Dict[str, Any]]:
     parameters = []
     for param in all_route_params:
index e53874be96902b3e1995825a144cc66a44333023..1f3cb1403ee78fbbd166d578c2523be0c5196401 100644 (file)
@@ -11,7 +11,7 @@ security = HTTPBase(scheme="Other", auto_error=False)
 
 @app.get("/users/me")
 def read_current_user(
-    credentials: Optional[HTTPAuthorizationCredentials] = Security(security)
+    credentials: Optional[HTTPAuthorizationCredentials] = Security(security),
 ):
     if credentials is None:
         return {"msg": "Create an account first"}
index d34433ec09e699f8c00f4099c11445e983b64316..9ddd1246f2c321df70910fe391795a2c6987f0a1 100644 (file)
@@ -11,7 +11,7 @@ security = HTTPBearer(auto_error=False)
 
 @app.get("/users/me")
 def read_current_user(
-    credentials: Optional[HTTPAuthorizationCredentials] = Security(security)
+    credentials: Optional[HTTPAuthorizationCredentials] = Security(security),
 ):
     if credentials is None:
         return {"msg": "Create an account first"}
index 52ee0484fe384bfa455eaf273e2c3515bff0ca01..d0af7afa4edfa5b57720331bed5baac2a5702797 100644 (file)
@@ -11,7 +11,7 @@ security = HTTPDigest(auto_error=False)
 
 @app.get("/users/me")
 def read_current_user(
-    credentials: Optional[HTTPAuthorizationCredentials] = Security(security)
+    credentials: Optional[HTTPAuthorizationCredentials] = Security(security),
 ):
     if credentials is None:
         return {"msg": "Create an account first"}