X Tutup
Skip to content

refactor lists delete in prep for fastapi#11986

Merged
RayBB merged 1 commit intomasterfrom
fastapi-prep/lists-delete
Mar 3, 2026
Merged

refactor lists delete in prep for fastapi#11986
RayBB merged 1 commit intomasterfrom
fastapi-prep/lists-delete

Conversation

@RayBB
Copy link
Collaborator

@RayBB RayBB commented Mar 3, 2026

No description provided.

@RayBB
Copy link
Collaborator Author

RayBB commented Mar 3, 2026

AI review

Summary: Refactoring to extract delete logic into a static method process_delete for future FastAPI migration.
Changes:

  • Moved cache invalidation and delete document save from POST method to new @staticmethod process_delete
  • All tests and checks pass ✓
    Potential Risks:
  1. Minimal risk - This is a straightforward refactor. Logic is preserved:
    • Cache key: "core.patron_lists.%s" % web.safestr(doc.key)
    • Delete doc: {"key": key, "type": {"key": "/type/delete"}}
    • Save with action="lists" and comment="Deleted list."
  2. Static method constraint - The method uses web.ctx.site (global context) rather than instance state, so making it static is appropriate.
  3. No error handling change - The try/except in POST still catches ClientException from process_delete.
    Verdict: Safe to merge. The refactoring is clean and maintains identical behavior.

@RayBB RayBB merged commit 3a7fb6c into master Mar 3, 2026
8 checks passed
@RayBB RayBB deleted the fastapi-prep/lists-delete branch March 3, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup