mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	Cleaned up admin view code to use new 'pk' lookup syntax
git-svn-id: http://code.djangoproject.com/svn/django/trunk@468 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -1048,7 +1048,7 @@ def delete_stage(request, app_label, module_name, object_id): | |||||||
|     if not request.user.has_perm(app_label + '.' + opts.get_delete_permission()): |     if not request.user.has_perm(app_label + '.' + opts.get_delete_permission()): | ||||||
|         raise PermissionDenied |         raise PermissionDenied | ||||||
|     try: |     try: | ||||||
|         obj = mod.get_object(**{'%s__exact' % opts.pk.name: object_id}) |         obj = mod.get_object(pk=object_id) | ||||||
|     except ObjectDoesNotExist: |     except ObjectDoesNotExist: | ||||||
|         raise Http404 |         raise Http404 | ||||||
|  |  | ||||||
| @@ -1082,7 +1082,7 @@ def history(request, app_label, module_name, object_id): | |||||||
|         order_by=("action_time",), select_related=True) |         order_by=("action_time",), select_related=True) | ||||||
|     # If no history was found, see whether this object even exists. |     # If no history was found, see whether this object even exists. | ||||||
|     try: |     try: | ||||||
|         obj = mod.get_object(**{'%s__exact' % opts.pk.name: object_id}) |         obj = mod.get_object(pk=object_id) | ||||||
|     except ObjectDoesNotExist: |     except ObjectDoesNotExist: | ||||||
|         raise Http404 |         raise Http404 | ||||||
|     t = template_loader.get_template('admin_object_history') |     t = template_loader.get_template('admin_object_history') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user