Gauravwagh / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
Other
0 stars 0 forks source link

Caught KeyError while rendering: u'object_name' (at delete_selected_confirmation.html) #342

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There were changes to admin/delete_selected_confirmation.html template at 
Django revision 15250 (http://code.djangoproject.com/changeset/15250). And 
object_name context variable was renamed to objects_name. Patch to fix an issue 
attached.

What steps will reproduce the problem?
1. Check some objects and remove them

What is the expected output? What do you see instead?
I'm expect the confirmation page. But got a
TemplateSyntaxError at /admin/auth/user/
Caught KeyError while rendering: u'object_name'

What version of the product are you using? On what operating system?
Django trunk & Grappelli trunk.

Original issue reported on code.google.com by oleg.lomaka@gmail.com on 27 Jan 2011 at 1:44

Attachments:

GoogleCodeExporter commented 9 years ago
I second this.

Original comment by gor...@gmail.com on 1 Feb 2011 at 1:53

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 1 Feb 2011 at 9:30

GoogleCodeExporter commented 9 years ago
Just a quick note - I temporarily fixed this in my code by doing the following:

in/delete_selected_confirmation.html 
Index: templates/admin/delete_selected_confirmation.html
===================================================================
--- templates/admin/delete_selected_confirmation.html   (revision 1401)
+++ templates/admin/delete_selected_confirmation.html   (working copy)
@@ -18,7 +18,7 @@
     <div class="container-grid delete-confirmation">
         {% if perms_lacking %}
             <div class="module">
-                <h2>{% blocktrans %}Deleting the {{ object_name }} would 
result in deleting related objects, but your account doesn't have permission to 
delete the following types of objects:{% endblocktrans %}</h2>
+                <h2>{% blocktrans %}Deleting the {% endblocktrans %}{{ 
object_name }}{% blocktrans %} would result in deleting related objects, but 
your account doesn't have permission to delete the following types of 
objects:{% endblocktrans %}</h2>
                 <div class="row">
                     <ul class="rte">
                         {% for obj in perms_lacking %}
@@ -29,7 +29,7 @@
             </div>
         {% else %}
             <div class="module">
-                <h2>{% blocktrans %}Are you sure you want to delete the 
selected {{ object_name }} objects? All of the following objects and their 
related items will be deleted:{% endblocktrans %}</h2>
+                <h2>{% blocktrans %}Are you sure you want to delete the 
selected {% endblocktrans %}{{ object_name }}{% blocktrans %} objects? All of 
the following objects and their related items will be deleted:{% endblocktrans 
%}</h2>
                 {% for deleteable_object in deletable_objects %}
                     <div class="row">
                         <ul class="rte">{{ deleteable_object|unordered_list }}</ul>

Original comment by gor...@gmail.com on 2 Feb 2011 at 5:39

GoogleCodeExporter commented 9 years ago
fixed with r1403

Original comment by sehmaschine on 3 Feb 2011 at 3:16

GoogleCodeExporter commented 9 years ago
I'm still getting this error, but for 'objects_name' instead, as r1403 
specifies.

Original comment by inwN...@gmail.com on 10 Feb 2011 at 3:20

GoogleCodeExporter commented 9 years ago
do a django-update, than the error´s gone.

Original comment by sehmaschine on 10 Feb 2011 at 3:23