Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

magic-removal: Fixed #1674 -- Generic update_object() view now handle…

…s PKs named something other than 'id'

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5a2b52c9e8007edc483a4e94988c58106a6d2b4b 1 parent e55924b
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/views/generic/create_update.py
View
2  django/views/generic/create_update.py
@@ -101,7 +101,7 @@ def update_object(request, model, object_id=None, slug=None,
except ObjectDoesNotExist:
raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs)
- manipulator = model.ChangeManipulator(object.id, follow=follow)
+ manipulator = model.ChangeManipulator(getattr(object, object._meta.pk.name), follow=follow)
if request.POST:
new_data = request.POST.copy()

0 comments on commit 5a2b52c

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