Bug: No validation on project update when no fields provided #8

Closed
opened 2026-05-09 05:18:45 +00:00 by Mark · 1 comment
Owner

Severity: Low

handle_update_project in project_commands.py (line 239) calls client.update_project() with title/description even when both are None. This sends an empty POST {} to the API, which is pointless and may cause unexpected behavior depending on the server implementation.

def handle_update_project(args, config):
    client = APIClient(...)
    try:
        project = client.update_project(
            project_id=args.project_id,
            title=args.title,          # None if not provided
            description=args.description  # None if not provided
        )

Similarly, the API method update_project in client.py builds data = {} and adds nothing if both are None.

Fix: Add a validation check before the API call, similar to how handle_configure checks if not updates::

if not args.title and not args.description:
    print("No update fields provided. Use --title and/or --description.")
    return

Same pattern should be applied to handle_update_task and the bulk update handler.

**Severity: Low** `handle_update_project` in `project_commands.py` (line 239) calls `client.update_project()` with title/description even when both are None. This sends an empty POST `{}` to the API, which is pointless and may cause unexpected behavior depending on the server implementation. ```python def handle_update_project(args, config): client = APIClient(...) try: project = client.update_project( project_id=args.project_id, title=args.title, # None if not provided description=args.description # None if not provided ) ``` Similarly, the API method `update_project` in `client.py` builds `data = {}` and adds nothing if both are None. **Fix:** Add a validation check before the API call, similar to how `handle_configure` checks `if not updates:`: ```python if not args.title and not args.description: print("No update fields provided. Use --title and/or --description.") return ``` Same pattern should be applied to `handle_update_task` and the bulk update handler.
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-14 22:04:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/vikunja-cli#8
No description provided.