Project

General

Profile

Actions

Bug #110

open

when creating projects via API, the "completed" field of the request body is ignored

Added by Sam Pearson 21 days ago. Updated 21 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
01/01/2026
Due date:
% Done:

0%

Estimated time:

Description

When creating a project, the completed attribute will have a value of false even when sending a "true" value in the request body

Request Body

{
  "title": "Completed task",
  "completed": true
}

Response Body

{
  "completed": false,
  "completed_at": null,
  "created_at": "2026-01-01T17:31:35.683815",
  "description": null,
  "id": 32,
  "principles": [],
  "project_id": null,
  "tags": [],
  "title": "Completed task",
  "updated_at": "2026-01-01T17:31:35.683818",
  "user_id": 2
}

Note the NULL value for "completed"
Actions #1

Updated by Sam Pearson 21 days ago

This may not actually be a bug; we probably want a different endpoint for completing things, but in any case, here's the create_project function from the service file and you can see that it doesn't try to initialize the completed value

    def create_project(self, user_id: int, data: Dict[str, Any]) -> Project:
        if not data.get('title'):
            raise ProjectValidationError("Project title is required")
            
        return self.repository.create(
            user_id=user_id,
            title=data['title'],
            description=data.get('description'),
            win_condition=data.get('win_condition'),
            reason=data.get('reason'),
            next_step=data.get('next_step'),
            active=True
        )
Actions

Also available in: Atom PDF