From b7e0bac71af762ba1381710631238b1aa1dcef9f Mon Sep 17 00:00:00 2001 From: Dominik Fretz Date: Wed, 27 Aug 2025 10:11:57 +1000 Subject: [PATCH] Fix conditional checks in todo payload builders to allow falsey values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed truthy checks to explicit 'is not None' checks in create_todo and update_todo methods to properly handle intentionally empty/false values (empty lists, False) being sent to the API for field clearing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- basecamp_client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/basecamp_client.py b/basecamp_client.py index 35dc48e..612ac8b 100644 --- a/basecamp_client.py +++ b/basecamp_client.py @@ -181,17 +181,17 @@ class BasecampClient: endpoint = f'buckets/{project_id}/todolists/{todolist_id}/todos.json' data = {'content': content} - if description: + if description is not None: data['description'] = description - if assignee_ids: + if assignee_ids is not None: data['assignee_ids'] = assignee_ids - if completion_subscriber_ids: + if completion_subscriber_ids is not None: data['completion_subscriber_ids'] = completion_subscriber_ids - if notify: + if notify is not None: data['notify'] = notify - if due_on: + if due_on is not None: data['due_on'] = due_on - if starts_on: + if starts_on is not None: data['starts_on'] = starts_on response = self.post(endpoint, data)