mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-09-30 10:03:13 +00:00
style: apply ruff format so ci-python-app lint passes
This commit is contained in:
parent
8879028a95
commit
19cbddd2fc
4 changed files with 19 additions and 15 deletions
|
|
@ -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}},
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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"})
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue