Skip to content

Commit

Permalink
Fixed #168 -- admin object history was assuming primary key was named…
Browse files Browse the repository at this point in the history
… 'id'. Thanks, clintecker@gmail.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Jul 23, 2005
1 parent 4ab1e19 commit 768c17e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/views/admin/main.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1077,7 +1077,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(id__exact=object_id) obj = mod.get_object(**{'%s__exact' % opts.pk.name: 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')
Expand Down

0 comments on commit 768c17e

Please sign in to comment.