style: apply ruff format so ci-python-app lint passes

This commit is contained in:
Adam Moussa 2026-09-21 15:06:24 -04:00
parent 8879028a95
commit 19cbddd2fc
No known key found for this signature in database
4 changed files with 19 additions and 15 deletions

View file

@ -81,11 +81,16 @@ def create_app() -> Flask:
qs = request.args.to_dict(flat=True)
path_params = {}
parts = path.strip("/").split("/")
if len(parts) >= 3 and parts[0] == "api" and parts[1] in {
"menu",
"orders",
"form-status",
}:
if (
len(parts) >= 3
and parts[0] == "api"
and parts[1]
in {
"menu",
"orders",
"form-status",
}
):
path_params["week"] = parts[2]
event = {
"requestContext": {"http": {"method": request.method, "path": path}},

View file

@ -183,15 +183,13 @@ def main():
with open(output_file, "w") as f:
f.write(html)
mode = (
"cloud"
if args.api_url
else ("same-origin" if google_client_id else "local")
)
mode = "cloud" if args.api_url else ("same-origin" if google_client_id else "local")
print(f"Generated order form ({mode} mode): {output_file}")
print(f" {menu['meal_count']} meals from menu scraped {menu['scraped_at'][:10]}")
if mode == "local":
print(" Start the server with: PYTHONPATH=src:src/shared python3 -m server.app")
print(
" Start the server with: PYTHONPATH=src:src/shared python3 -m server.app"
)
elif mode == "same-origin":
print(" API paths are relative /api/* on the form origin")
else:

View file

@ -350,9 +350,7 @@ def _require_publish_key(event) -> dict | None:
return response(403, {"error": "Forbidden"})
headers = event.get("headers") or {}
provided = (
headers.get("x-meals-publish-key")
or headers.get("X-Meals-Publish-Key")
or ""
headers.get("x-meals-publish-key") or headers.get("X-Meals-Publish-Key") or ""
)
if not _keys_match(provided, expected):
return response(403, {"error": "Forbidden"})

View file

@ -40,4 +40,7 @@ def test_email_report_not_in_remaining_config():
def test_job_schedules_disabled_outside_prod():
scheduler = (TERRAFORM / "scheduler.tf").read_text()
assert 'state = local.is_prod ? "ENABLED" : "DISABLED"' in scheduler
assert (
'state = local.is_prod ? "ENABLED" : "DISABLED"'
in scheduler
)