mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 22:49:50 +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 = 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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user