﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2955	[patch] admin's delete_stage() incorrectly displays 'article_set' rather than 'article' when user has insufficient perms	mattimustang@…	Adrian Holovaty	"Using the models in http://www.djangoproject.com/documentation/models/many_to_one/ as an example, when a user deletes a Reporter without sufficient permissions to also delete the reporter's Articles the following message is displayed:

{{{

Deleting the reporter 'John Doe' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:

    * article_set

}}}

This should really read:

{{{

Deleting the reporter 'John Doe' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:

    * article

}}}


The following patch fixes this issue:

{{{
Index: django/contrib/admin/views/main.py
===================================================================
--- django/contrib/admin/views/main.py  (revision 3917)
+++ django/contrib/admin/views/main.py  (working copy)
@@ -454,7 +454,7 @@
             if related.opts.admin and has_related_objs:
                 p = '%s.%s' % (related.opts.app_label, related.opts.get_delete_permission())
                 if not user.has_perm(p):
-                    perms_needed.add(rel_opts_name)
+                    perms_needed.add(related.opts.verbose_name)
     for related in opts.get_all_related_many_to_many_objects():
         if related.opts in opts_seen:
             continue
}}}

regards

matthew"	defect	closed	contrib.admin	dev	normal	fixed			Unreviewed	1	0	0	0	0	0
