This commit is contained in:
Nathan Agrin 2012-12-07 16:06:33 -08:00
commit 88379744fe

View File

@ -106,6 +106,10 @@ class UpdateModelMixin(object):
# pk and/or slug attributes are implicit in the URL.
pk = self.kwargs.get(self.pk_url_kwarg, None)
if pk:
try:
pk = int(pk)
except ValueError:
pass
setattr(obj, 'pk', pk)
slug = self.kwargs.get(self.slug_url_kwarg, None)