mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-24 23:19:47 +03:00
Merge 517440004b
into c1be29418b
This commit is contained in:
commit
88379744fe
|
@ -106,6 +106,10 @@ class UpdateModelMixin(object):
|
||||||
# pk and/or slug attributes are implicit in the URL.
|
# pk and/or slug attributes are implicit in the URL.
|
||||||
pk = self.kwargs.get(self.pk_url_kwarg, None)
|
pk = self.kwargs.get(self.pk_url_kwarg, None)
|
||||||
if pk:
|
if pk:
|
||||||
|
try:
|
||||||
|
pk = int(pk)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
setattr(obj, 'pk', pk)
|
setattr(obj, 'pk', pk)
|
||||||
|
|
||||||
slug = self.kwargs.get(self.slug_url_kwarg, None)
|
slug = self.kwargs.get(self.slug_url_kwarg, None)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user