Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #10600 -- Allow for format marker reordering in a translatable …

…string.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10141 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2dfdc2b01b9bdfe8fcff2706fef678b2186a6cdf 1 parent 37f25d4
Malcolm Tredinnick authored

Showing 1 changed file with 13 additions and 13 deletions. Show diff stats Hide diff stats

  1. 26  django/contrib/admin/options.py
26  django/contrib/admin/options.py
@@ -457,11 +457,11 @@ def get_action(self, action):
457 457
     def delete_selected(self, request, queryset):
458 458
         """
459 459
         Default action which deletes the selected objects.
460  
-        
  460
+
461 461
         In the first step, it displays a confirmation page whichs shows all
462 462
         the deleteable objects or, if the user has no permission one of the
463 463
         related childs (foreignkeys) it displays a "permission denied" message.
464  
-        
  464
+
465 465
         In the second step delete all selected objects and display the change
466 466
         list again.
467 467
         """
@@ -474,7 +474,7 @@ def delete_selected(self, request, queryset):
474 474
 
475 475
         # Populate deletable_objects, a data structure of all related objects that
476 476
         # will also be deleted.
477  
-        
  477
+
478 478
         # deletable_objects must be a list if we want to use '|unordered_list' in the template
479 479
         deletable_objects = []
480 480
         perms_needed = set()
@@ -495,9 +495,9 @@ def delete_selected(self, request, queryset):
495 495
                     obj_display = force_unicode(obj)
496 496
                     self.log_deletion(request, obj, obj_display)
497 497
                 queryset.delete()
498  
-                self.message_user(request, _("Successfully deleted %d %s.") % (
499  
-                    n, model_ngettext(self.opts, n)
500  
-                ))
  498
+                self.message_user(request, _("Successfully deleted %(count)d %(items)s.") % {
  499
+                    "count": n, "items": model_ngettext(self.opts, n)
  500
+                })
501 501
             # Return None to display the change list page again.
502 502
             return None
503 503
 
@@ -512,7 +512,7 @@ def delete_selected(self, request, queryset):
512 512
             "app_label": app_label,
513 513
             'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
514 514
         }
515  
-        
  515
+
516 516
         # Display the confirmation page
517 517
         return render_to_response(self.delete_confirmation_template or [
518 518
             "admin/%s/%s/delete_selected_confirmation.html" % (app_label, opts.object_name.lower()),
@@ -685,15 +685,15 @@ def response_action(self, request, queryset):
685 685
         if action_form.is_valid():
686 686
             action = action_form.cleaned_data['action']
687 687
             func, name, description = self.get_actions(request)[action]
688  
-            
689  
-            # Get the list of selected PKs. If nothing's selected, we can't 
  688
+
  689
+            # Get the list of selected PKs. If nothing's selected, we can't
690 690
             # perform an action on it, so bail.
691 691
             selected = request.POST.getlist(helpers.ACTION_CHECKBOX_NAME)
692 692
             if not selected:
693 693
                 return None
694 694
 
695 695
             response = func(request, queryset.filter(pk__in=selected))
696  
-                        
  696
+
697 697
             # Actions may return an HttpResponse, which will be used as the
698 698
             # response from the POST. If not, we'll be a good little HTTP
699 699
             # citizen and redirect back to the changelist page.
@@ -901,7 +901,7 @@ def changelist_view(self, request, extra_context=None):
901 901
             response = self.response_action(request, queryset=cl.get_query_set())
902 902
             if response:
903 903
                 return response
904  
-                
  904
+
905 905
         # If we're allowing changelist editing, we need to construct a formset
906 906
         # for the changelist given all the fields to be edited. Then we'll
907 907
         # use the formset to validate/process POSTed data.
@@ -946,10 +946,10 @@ def changelist_view(self, request, extra_context=None):
946 946
             media = self.media + formset.media
947 947
         else:
948 948
             media = self.media
949  
-            
  949
+
950 950
         # Build the action form and populate it with available actions.
951 951
         action_form = self.action_form(auto_id=None)
952  
-        action_form.fields['action'].choices = self.get_action_choices(request)        
  952
+        action_form.fields['action'].choices = self.get_action_choices(request)
953 953
 
954 954
         context = {
955 955
             'title': cl.title,

0 notes on commit 2dfdc2b

Please sign in to comment.
Something went wrong with that request. Please try again.