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

@confirm_action doesn't respect @admin.action #37

Closed
vkurilin opened this issue May 7, 2022 · 0 comments
Closed

@confirm_action doesn't respect @admin.action #37

vkurilin opened this issue May 7, 2022 · 0 comments

Comments

@vkurilin
Copy link
Contributor

vkurilin commented May 7, 2022

Describe the bug
admin_confirm.admin.confirm_action doesn't respect django.contrib.admin.action

To Reproduce
Steps to reproduce the behavior:

from admin_confirm import AdminConfirmMixin
from admin_confirm.admin import confirm_action
from django.contrib import admin, messages
from django.contrib.admin import ModelAdmin

from demo_app.models import DemoModel


@confirm_action
@admin.action(description='Demo description')
def demo_action(modeladmin, request, queryset):
    messages.info(request, f'Demo action!')


@admin.register(DemoModel)
class DemoModelAdmin(AdminConfirmMixin, ModelAdmin):
    confirm_change = False
    confirm_add = False

    actions = (demo_action, )

Expected behavior

  • action name is "Demo description"
  • confirmation page works

Actual behavior

  • action name is "Func wrapper"
  • confirmation page fails with "you don't have permissions"

Screenshots
Screenshot 2022-05-07 at 12 57 57
Screenshot 2022-05-07 at 12 57 47

Versions (please complete the following information):
latest

vkurilin pushed a commit to vkurilin/django-admin-confirm that referenced this issue May 7, 2022
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