Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for POST instead of GET requests on clicking menu items. #146

Open
dylanhillier opened this issue May 8, 2024 · 0 comments
Open

Comments

@dylanhillier
Copy link

dylanhillier commented May 8, 2024

I would like to add a logout/sign out menu item which requires the request to be a POST instead of a get.
This is in light of this change: https://code.djangoproject.com/ticket/15619

For example, something like:

Menu.add_item(
    "user",
    MenuItem(
        profile_title,
        reverse("logout"),
        post_request=True,  # <<<<<<<< new arg.
        icon="box-arrow-right"
    ),
)

Then instead of generating a <a href=xxxx /> it generates a <form method="post" .... </form>

If there is an existing clean way of doing this i would also be interested.

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

No branches or pull requests

1 participant