Fix conditional checks in todo payload builders to allow falsey values
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 <noreply@anthropic.com>
This commit is contained in:
@@ -181,17 +181,17 @@ class BasecampClient:
|
|||||||
endpoint = f'buckets/{project_id}/todolists/{todolist_id}/todos.json'
|
endpoint = f'buckets/{project_id}/todolists/{todolist_id}/todos.json'
|
||||||
data = {'content': content}
|
data = {'content': content}
|
||||||
|
|
||||||
if description:
|
if description is not None:
|
||||||
data['description'] = description
|
data['description'] = description
|
||||||
if assignee_ids:
|
if assignee_ids is not None:
|
||||||
data['assignee_ids'] = assignee_ids
|
data['assignee_ids'] = assignee_ids
|
||||||
if completion_subscriber_ids:
|
if completion_subscriber_ids is not None:
|
||||||
data['completion_subscriber_ids'] = completion_subscriber_ids
|
data['completion_subscriber_ids'] = completion_subscriber_ids
|
||||||
if notify:
|
if notify is not None:
|
||||||
data['notify'] = notify
|
data['notify'] = notify
|
||||||
if due_on:
|
if due_on is not None:
|
||||||
data['due_on'] = due_on
|
data['due_on'] = due_on
|
||||||
if starts_on:
|
if starts_on is not None:
|
||||||
data['starts_on'] = starts_on
|
data['starts_on'] = starts_on
|
||||||
|
|
||||||
response = self.post(endpoint, data)
|
response = self.post(endpoint, data)
|
||||||
|
|||||||
Reference in New Issue
Block a user