mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 22:49:50 +03:00
Fix issue where pk was was being set to a string.
This commit is contained in:
parent
b170973993
commit
06c4b90ec4
|
@ -105,6 +105,10 @@ class UpdateModelMixin(object):
|
|||
"""
|
||||
# pk and/or slug attributes are implicit in the URL.
|
||||
pk = self.kwargs.get(self.pk_url_kwarg, None)
|
||||
try:
|
||||
pk = int(pk)
|
||||
except ValueError:
|
||||
pass
|
||||
if pk:
|
||||
setattr(obj, 'pk', pk)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user