django-orchestra/orchestra/contrib/mailer/actions.py
2023-07-09 07:51:51 +00:00

9 lines
251 B
Python

from django.urls import reverse
from django.shortcuts import redirect
def last(modeladmin, request, queryset):
last = queryset.model.objects.latest('id')
url = reverse('admin:mailer_message_change', args=(last.pk,))
return redirect(url)