[PR #2616] [MERGED] refactor(projects): use getAllProjectsForUser in getProjectsToDelete #5772

Closed
opened 2026-04-16 13:51:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2616
Author: @kolaente
Created: 4/13/2026
Status: Merged
Merged: 4/13/2026
Merged by: @kolaente

Base: mainHead: claude/allow-delete-disabled-accounts-pa9tn


📝 Commits (1)

  • bf490dd fix(user): allow deleting disabled accounts via the cli

📊 Changes

2 files changed (+18 additions, -7 deletions)

View changed files

📝 pkg/models/user_delete.go (+5 -7)
📝 pkg/models/user_delete_test.go (+13 -0)

📄 Description

Summary

Refactored the getProjectsToDelete function to use the existing getAllProjectsForUser helper method instead of directly calling ReadAll, improving code reusability and consistency.

Key Changes

  • Replaced direct ReadAll call with getAllProjectsForUser helper function in getProjectsToDelete
  • Simplified project retrieval logic by using projectOptions struct with getArchived: true flag
  • Removed unnecessary nil check on the result since getAllProjectsForUser returns a properly typed slice
  • Added test case for deleting a disabled user (user ID 17) to ensure the refactored code handles this scenario correctly

Implementation Details

  • The refactoring maintains the same functionality while reducing code duplication
  • Uses projectOptions with page: 0, perPage: -1, and getArchived: true to match the previous behavior
  • The new test verifies that disabled users can be successfully deleted and properly removed from the database

https://claude.ai/code/session_01W4dMPFj321sB3oFdTi6qwc


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2616 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 4/13/2026 **Status:** ✅ Merged **Merged:** 4/13/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `claude/allow-delete-disabled-accounts-pa9tn` --- ### 📝 Commits (1) - [`bf490dd`](https://github.com/go-vikunja/vikunja/commit/bf490dd55bd45edf510b9c9e5a78af317232d7fa) fix(user): allow deleting disabled accounts via the cli ### 📊 Changes **2 files changed** (+18 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `pkg/models/user_delete.go` (+5 -7) 📝 `pkg/models/user_delete_test.go` (+13 -0) </details> ### 📄 Description ## Summary Refactored the `getProjectsToDelete` function to use the existing `getAllProjectsForUser` helper method instead of directly calling `ReadAll`, improving code reusability and consistency. ## Key Changes - Replaced direct `ReadAll` call with `getAllProjectsForUser` helper function in `getProjectsToDelete` - Simplified project retrieval logic by using `projectOptions` struct with `getArchived: true` flag - Removed unnecessary nil check on the result since `getAllProjectsForUser` returns a properly typed slice - Added test case for deleting a disabled user (user ID 17) to ensure the refactored code handles this scenario correctly ## Implementation Details - The refactoring maintains the same functionality while reducing code duplication - Uses `projectOptions` with `page: 0`, `perPage: -1`, and `getArchived: true` to match the previous behavior - The new test verifies that disabled users can be successfully deleted and properly removed from the database https://claude.ai/code/session_01W4dMPFj321sB3oFdTi6qwc --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 13:51:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5772