From 5a461eea32a41403592f5fb05131de33b14652ce Mon Sep 17 00:00:00 2001 From: Greg Kempe Date: Wed, 27 Mar 2024 10:28:28 +0200 Subject: [PATCH] fix bug where un-repealed legislation is not reset --- peachjam/adapters/indigo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peachjam/adapters/indigo.py b/peachjam/adapters/indigo.py index 856c925db..0c826d424 100644 --- a/peachjam/adapters/indigo.py +++ b/peachjam/adapters/indigo.py @@ -263,8 +263,8 @@ def update_document(self, url): commencements_json = self.client_get(f"{url}/commencements.json").json() field_data["commencements_json"] = commencements_json["commencements"] - if hasattr(model, "repealed") and document["repeal"]: - field_data["repealed"] = True + if hasattr(model, "repealed"): + field_data["repealed"] = bool(document["repeal"]) # the document may already be in the database, but not as the right document type. # It's unlikely, but does happen and is confusing to debug, so let's check for it explicitly.