Skip to content

Support intermediate confirmation pages for admin actions #63

@7tg

Description

@7tg

Description

Django admin actions can define intermediate confirmation pages that require user input before executing. These are currently not supported by the MCP.

Current Behavior

Admin actions are executed immediately with the provided IDs. Actions that require intermediate pages (confirmation dialogs, additional input) cannot be properly used.

Expected Behavior

Support a two-step workflow for actions that require confirmation:

  1. First call returns requires_confirmation: true with the confirmation template/fields
  2. Second call with confirmation data executes the action

Django Admin Reference

@admin.action(description="Archive selected articles")
def archive_articles(modeladmin, request, queryset):
    if 'confirm' not in request.POST:
        # Return intermediate page
        return render(request, 'admin/confirm_archive.html', {
            'queryset': queryset
        })
    # Execute action
    queryset.update(archived=True)

Implementation Notes

  • Detect when action returns an HttpResponse (intermediate page)
  • Extract form fields or confirmation requirements
  • Support a confirmed: true parameter on subsequent calls
  • May need to serialize intermediate state

Complexity

This is a complex feature as intermediate pages can have arbitrary forms and logic.

Labels

enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions