Hi guys, I recently begin to collaborate in a project based in Django 4.1.3, and I was assigned a task that involves get some info about my custom user and send email to each one. I resolute this creating a custom admin action when the admin when needed execute this action to send to the users the info needed by them. The issue here is there no way to see my custom actions on the Admin Panel, I’ve trying but anything works, can you help me to know what I am missing?
example code:
from django.contrib import admin, messages
from .models import User
# custom admin action to send user info
@admin.action(description='Send emails to selected users')
def send_user_info(modeladmin, request, queryset):
messages.success(request, "Emails sent successfully")
class UserAdmin(admin.ModelAdmin):
actions = [send_user_info]
admin.site.register(User, UserAdmin)