diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 73c2958..83246f2 100644
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
1251 | 1251 | 'admin/change_list.html' |
1252 | 1252 | ], context, current_app=self.admin_site.name) |
1253 | 1253 | |
| 1254 | def get_deleted_objects(self, objs, opts, request, using): |
| 1255 | """ |
| 1256 | Find all objects related to ``objs`` that should also be deleted. ``objs`` |
| 1257 | must be a homogenous iterable of objects (e.g. a QuerySet). |
| 1258 | |
| 1259 | Returns a nested list of strings suitable for display in the |
| 1260 | template with the ``unordered_list`` filter. |
| 1261 | |
| 1262 | By default this just passes the request on to |
| 1263 | django.contrib.admin.util.get_deleted_objects, but this method exists |
| 1264 | to allow subclasses to override the permissions required to delete |
| 1265 | things. |
| 1266 | """ |
| 1267 | return django.contrib.admin.util.get_deleted_objects(objs, opts, |
| 1268 | request.user, self.admin_site, using) |
| 1269 | |
1254 | 1270 | @csrf_protect_m |
1255 | 1271 | @transaction.commit_on_success |
1256 | 1272 | def delete_view(self, request, object_id, extra_context=None): |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
1270 | 1286 | |
1271 | 1287 | # Populate deleted_objects, a data structure of all related objects that |
1272 | 1288 | # will also be deleted. |
1273 | | (deleted_objects, perms_needed, protected) = get_deleted_objects( |
1274 | | [obj], opts, request.user, self.admin_site, using) |
| 1289 | (deleted_objects, perms_needed, protected) = self.get_deleted_objects( |
| 1290 | [obj], opts, request, using) |
1275 | 1291 | |
1276 | 1292 | if request.POST: # The user has already confirmed the deletion. |
1277 | 1293 | if perms_needed: |