aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/mixins.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/mixins.py')
-rw-r--r--rest_framework/mixins.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py
index 1edcfa5c..8dc0c329 100644
--- a/rest_framework/mixins.py
+++ b/rest_framework/mixins.py
@@ -113,6 +113,10 @@ class UpdateModelMixin(object):
slug_field = self.get_slug_field()
setattr(obj, slug_field, slug)
+ # Ensure we clean the attributes so that we don't eg return integer
+ # pk using a string representation, as provided by the url conf kwarg.
+ obj.full_clean()
+
class DestroyModelMixin(object):
"""