django-orchestra/orchestra/contrib/mailer/actions.py

9 lines
251 B
Python
Raw Permalink Normal View History

2023-07-09 07:51:51 +00:00
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)