From 5c5f7eb344d28afb91e947243a6f96b337ea0ce2 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 8 Jul 2021 16:59:43 -0700 Subject: [PATCH] Expose accepts_appointments and accepts_walkins in API, refs #705 --- vaccinate/api/serialize.py | 4 ++++ vaccinate/api/test_search.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/vaccinate/api/serialize.py b/vaccinate/api/serialize.py index 439ddbb..ace2b0f 100644 --- a/vaccinate/api/serialize.py +++ b/vaccinate/api/serialize.py @@ -89,6 +89,8 @@ def location_json_queryset(queryset: QuerySet[Location]) -> QuerySet[Location]: "vaccinefinder_location_id", "vaccinespotter_location_id", "vaccines_offered", + "accepts_appointments", + "accepts_walkins", "zip_code", "hours", "hours_json", @@ -179,6 +181,8 @@ def location_v0_json(location: Location) -> Dict[str, object]: "hours": {"unstructured": location.hours, "structured": location.hours_json}, "website": location.website, "vaccines_offered": location.vaccines_offered, + "accepts_appointments": location.accepts_appointments, + "accepts_walkins": location.accepts_walkins, "concordances": [str(c) for c in location.concordances.all()], "last_verified_by_vts": location.dn_latest_non_skip_report.created_at.isoformat() if location.dn_latest_non_skip_report diff --git a/vaccinate/api/test_search.py b/vaccinate/api/test_search.py index 9c8997a..692f5d2 100644 --- a/vaccinate/api/test_search.py +++ b/vaccinate/api/test_search.py @@ -273,6 +273,8 @@ def test_search_locations_format_v0preview(client, api_key, location): "hours", "website", "vaccines_offered", + "accepts_appointments", + "accepts_walkins", "concordances", "last_verified_by_vts", "vts_url",