[lint] fix lint
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

- missing-function-docstring
- redefined-outer-name
- use-sequence-for-iteration
This commit is contained in:
SouthFox 2023-07-08 16:58:53 +08:00
parent 35a771ac99
commit ef2909064e

9
app.py
View file

@ -7,14 +7,15 @@ from demo import config
app = Flask(__name__) app = Flask(__name__)
def is_ap_requested(request: Request) -> bool: def is_ap_requested(ap_request: Request) -> bool:
accept_str = request.headers.get("accept") """Check request accept headers."""
accept_str = ap_request.headers.get("accept")
if accept_str is None: if accept_str is None:
return False return False
for i in { for i in [
"application/activity+json", "application/activity+json",
"application/ld+json", "application/ld+json",
}: ]:
if accept_str.startswith(i): if accept_str.startswith(i):
return True return True
return False return False